Simple Quick Question....

txgeekgirl

Registered User.
Local time
Yesterday, 22:25
Joined
Jul 31, 2008
Messages
187
I need to capture the open Form Name as a Variable.

This is code I found from searching boards... but it throws me a Me. error (Invalid Use).

Dim strFormName as String
strFormName = Me.Name


I am trying to clean up some code where I have a couple of forms that use the same control name to pass a value. :rolleyes:
 
Where is the code? It would need to be in the code behind the form, not a standard module.
 
OK - So I need to maybe capture in a global from the open form then it would show in the standard Project Specific code.
 
That's it...
Code:
Dim Frms as String
Frms = Screen.ActiveForm.Name
MsgBox Frms
 
Where are you calling the code from? This will work just fine as long as your code is contained within the form that refers to the "Me". Else check out Help > ActiveForm property, or GotFocus.
 
Thank you all.... I was a little brain dead - calling it from a Project Specific set of modules thinking I wouldn't have to set a Global variable. :o

My boss took a look at my code this morning and said "Clean it up!"
 

Users who are viewing this thread

Back
Top Bottom