TheSearcher
Registered User.
- Local time
- Today, 11:06
- Joined
- Jul 21, 2011
- Messages
- 395
I'm trying to use a global variable to hold the name of a form. It works great and returns the correct form name but I get the error below when referencing it from within the form collection. Does anyone know why?
'On Open event of frm_X
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
Globals.glb_CurrentForm = frmCurrentForm.Name 'This returns the correct form name.
'Code in frm_Y
Forms!Globals.glb_CurrentForm!lst_Tasks.Requery
'On Open event of frm_X
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
Globals.glb_CurrentForm = frmCurrentForm.Name 'This returns the correct form name.
'Code in frm_Y
Forms!Globals.glb_CurrentForm!lst_Tasks.Requery