I'm sorry, I should have explained that one a little better.
- Forms![Form Name].[Control Name]
OR
- Forms![Form Name].[Property]
is the correct syntax when referring to a form from outside of it's form module.
I suspect this isn't going to be helpful to you in this particular instance, since if I understand you correctly, you are attempting to write the form name to a global variable to be used later in your code processing.
A function that would do this is:
- Public Function GetPreviousForm(formName As Form) As String
-
-
GetPreviousForm = formName.Name
-
-
End Function
-
This code would go into a standard code module, the global variable pForm would be declared as String at the top of the module. (i.e. Global pForm As String)
The code to call this function from any form's code module:
-
pForm = GetPreviousForm(Me)
-
Debug.Print pForm
-
Regards,
Scott