AOB
Registered User.
- Local time
- Today, 14:11
- Joined
- Sep 26, 2012
- Messages
- 621
Hi,
Is it possible (and how...) to declare a module-specific form variable (or any variable for that matter) at the top of said module, so it doesn't need to be set at the start of each subsequent procedure?
I have a module of code specific to one form with a number of procedures, each one of which requires me to Dim / Set the form variable. It would be much neater if I could do it once at the start.
What should the syntax be please?
Thanks
AOB
Is it possible (and how...) to declare a module-specific form variable (or any variable for that matter) at the top of said module, so it doesn't need to be set at the start of each subsequent procedure?
I have a module of code specific to one form with a number of procedures, each one of which requires me to Dim / Set the form variable. It would be much neater if I could do it once at the start.
What should the syntax be please?
Thanks
AOB
Code:
Option Compare Database
Option Explicit
Public Sub Populate(lngParameter As Long)
[INDENT][COLOR=red]Dim frm As Form[/COLOR]
[COLOR=red]Set frm = Forms("frmDetails")[/COLOR]
' etc etc...
[/INDENT]End Sub
Public Sub Validate(lngParameter As Long)
[INDENT][COLOR=red]Dim frm As Form[/COLOR]
[COLOR=red]Set frm = Forms("frmDetails")[/COLOR]
' etc etc...
[/INDENT]End Sub