Hi
I need to create a global variable (user access level) in my Access 2007 application, that can be accessed throughout the application. I believe this involves putting together a Standard Module and defining the variable within a Sub procedure?
Code for my module follows:
*************************
Option Compare Database
Option Explicit
' Standard Module
Sub SetGlobalVars()
Dim gblAccessLevel As String
gblAccessLevel = "XXX"
End Sub
*************************
The module runs in debug with no errors, but the variable is not recognised outside of the Standard Module.
My question is: How do I execute the module's code when the application starts up (in my case, a Login form) to set this instance variable?
Thank you.
I need to create a global variable (user access level) in my Access 2007 application, that can be accessed throughout the application. I believe this involves putting together a Standard Module and defining the variable within a Sub procedure?
Code for my module follows:
*************************
Option Compare Database
Option Explicit
' Standard Module
Sub SetGlobalVars()
Dim gblAccessLevel As String
gblAccessLevel = "XXX"
End Sub
*************************
The module runs in debug with no errors, but the variable is not recognised outside of the Standard Module.
My question is: How do I execute the module's code when the application starts up (in my case, a Login form) to set this instance variable?
Thank you.