Retrieving current formname

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In many vb routine one can refere to things with [forms]![formname]....etc.
In vb routine i want to store the formname i am in in a variable.
So i would like to use [forms]!avariablecontainingmyformname...
Can anyone tell me how to get 'your own' formname you are in?
 
Forms("MyFormName")

or

strForm = "MyFormName"

and then use Forms(strForm)

From within a form, you can use Me.Name to get that form's name.
 
In many vb routine one can refere to things with [forms]![formname]....etc.
In vb routine i want to store the formname i am in in a variable.
So i would like to use [forms]!avariablecontainingmyformname...
Can anyone tell me how to get 'your own' formname you are in?

If the code is within the form that you are using:
strFormName = Me.Name

You can also pass Me.Name as an argument directly to a sub routine
without having to create the variable.
 

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

Similar Threads


Back
Top