C
CES
All,
I'm assuming its "Public Function init_something()" but I can't seem to find a reference to the correct syntax. I'm using Access 2007.
Basically what I'm trying to do is initialize a list of global variables and I can't seem to figure out how to do it.
Option Compare Database
Public VariableName As String
'Call Init - Will throw an error
'VariableName = "Hello World" - Will throw an error
Option Explicit
Public Function Init()
VariableName = "Hello World"
End Function
Private Sub btName_Click()
MsgBox (VariableName)
End Sub
' this is the only way that I can seem to get this to work and I'm sure that there is a better way of doing it.
Private Sub test_Click()
If VariableName = "" Then
Call Init
End If
MsgBox (VariableName)
VariableName = "Some New Value"
End Sub
Also are all modules initiated when the database first opens?
Is there an order to when they are loaded?
Thanks in advance. - CES
I'm assuming its "Public Function init_something()" but I can't seem to find a reference to the correct syntax. I'm using Access 2007.
Basically what I'm trying to do is initialize a list of global variables and I can't seem to figure out how to do it.
Option Compare Database
Public VariableName As String
'Call Init - Will throw an error
'VariableName = "Hello World" - Will throw an error
Option Explicit
Public Function Init()
VariableName = "Hello World"
End Function
Private Sub btName_Click()
MsgBox (VariableName)
End Sub
' this is the only way that I can seem to get this to work and I'm sure that there is a better way of doing it.
Private Sub test_Click()
If VariableName = "" Then
Call Init
End If
MsgBox (VariableName)
VariableName = "Some New Value"
End Sub
Also are all modules initiated when the database first opens?
Is there an order to when they are loaded?
Thanks in advance. - CES