Finding the forms name in visual basic

M

Mabeline

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.
 
D

Daniel Pineault

If you need to determine the name of the parent form from the subform then
try something like

Me.Parent.Name
 
M

Mabeline

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top