I am trying to call a Public function from the VBCode executed on a cmdButton click.
I have a startMetricsDatabase (standard module) with the following code:
Option Compare Database
Public CurrentForm As String
Public PreviousForm As String
Public NextForm As String
Public CurrentXID As String
Public CurrentClarityID As String
Public Function VariableInit()
CurrentForm = "Frm-Login"
PreviousForm = "Frm-Login"
NextForm = "Frm-Login"
CurrentXID = xwvc03i
CurrentClarityID = 999999
MsgBox "Variables have been set", vbOKOnly
End Function
Public Function ShowPubVar()
MsgBox "CurrentForm = " & CurrentForm, vbOKOnly
MsgBox "PreviousForm = " & PreviousForm, vbOKOnly
MsgBox "NextForm = " & NextForm, vbOKOnly
MsgBox "CurrentXID = " & CurrentXID, vbOKOnly
MsgBox "CurrentClarityID = " & CurrentClarityID, vbOKOnly
End Function
Within my form, I have a cmdButton with the following code:
Private Sub cmd_Login_Click()
On Error GoTo Err_cmd_Login_Click
Call VariableInit
Call ShowPubVar
.
.
.
The code errors out with a compile error: Sub or Function not defined. Is my standard module built incorrectly?
I have a startMetricsDatabase (standard module) with the following code:
Option Compare Database
Public CurrentForm As String
Public PreviousForm As String
Public NextForm As String
Public CurrentXID As String
Public CurrentClarityID As String
Public Function VariableInit()
CurrentForm = "Frm-Login"
PreviousForm = "Frm-Login"
NextForm = "Frm-Login"
CurrentXID = xwvc03i
CurrentClarityID = 999999
MsgBox "Variables have been set", vbOKOnly
End Function
Public Function ShowPubVar()
MsgBox "CurrentForm = " & CurrentForm, vbOKOnly
MsgBox "PreviousForm = " & PreviousForm, vbOKOnly
MsgBox "NextForm = " & NextForm, vbOKOnly
MsgBox "CurrentXID = " & CurrentXID, vbOKOnly
MsgBox "CurrentClarityID = " & CurrentClarityID, vbOKOnly
End Function
Within my form, I have a cmdButton with the following code:
Private Sub cmd_Login_Click()
On Error GoTo Err_cmd_Login_Click
Call VariableInit
Call ShowPubVar
.
.
.
The code errors out with a compile error: Sub or Function not defined. Is my standard module built incorrectly?