I am trying to do some work on a database that was designed by someone else.
The following code lies behind a command button on a form...
I note that the programmer did not include the line "Option Explicit" at the top of any code throughout the database.
When I insert "Option Explicit" and attempt to compile the code the line in blue above results in a "variable not defined" error.
As will be noted the line rez = UpDatePerform() calls a function from a module.
How do I properly declare "rez" so that I can include the "Option Explicit" line at the top of this form's code?
Tom
The following code lies behind a command button on a form...
Code:
Private Sub CmdUpdatePerformTable_Click()
DoCmd.Echo False, "Visual Basic code is executing."
DoCmd.OpenForm "UpDatePERFORM"
DoCmd.Echo True, "Visual Basic code is executing."
DoCmd.Echo False, "Visual Basic code is executing."
[COLOR=blue]rez = UpDatePerform()[/color]
DoCmd.Echo True, "Visual Basic code is executing."
DoCmd.Close acForm, "UpDatePERFORM", acSaveYes
[NumRecordInPerform] = NumRecInPerform()
If [NumRecordInPerform] > 0 Then
CmdSession.Visible = True
DoCmd.GoToControl "CmdSession"
CmdUpdatePerformTable.Visible = False
End If
End Sub
I note that the programmer did not include the line "Option Explicit" at the top of any code throughout the database.
When I insert "Option Explicit" and attempt to compile the code the line in blue above results in a "variable not defined" error.
As will be noted the line rez = UpDatePerform() calls a function from a module.
How do I properly declare "rez" so that I can include the "Option Explicit" line at the top of this form's code?
Tom