Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finding the forms name in visual basic

0 views
Skip to first unread message

Mabeline

unread,
Nov 20, 2007, 8:47:01 PM11/20/07
to
Hi,

Is there anyway of finding the forms name that is currently being used by
the user in visual basic on a real time basis. Maybe something like:

if formname = "name"
variable = name
elseif formname = "othername"
variable = othername.
end if
end if

I am using a subform in 2 different forms that have different names for
specific reasons and I need to know which form the user is working with so
that I can ensure the correct table is updated.

Can anyone help.

Thanks in advance

Mabeline.

Daniel Pineault

unread,
Nov 20, 2007, 9:14:00 PM11/20/07
to
Me.Form.Name
--
Hope this helps,

Daniel Pineault

Daniel Pineault

unread,
Nov 20, 2007, 9:20:00 PM11/20/07
to
If you need to determine the name of the parent form from the subform then
try something like

Me.Parent.Name
--
Hope this helps,

Daniel Pineault

Mabeline

unread,
Nov 25, 2007, 2:56:01 PM11/25/07
to
Hi Daniel,

Only got the chance over the weekend to run this but it doesn't seem to work.

I am fairly new to visual basic but believe I have the statement right to
check the name of the form as you suggested but it doesn't work. The
statement is :

if me.parent.name = "formname" then

Am I not wording this correctly?

Thanks for your help.

Mabeline.

0 new messages