M
Mavis
Hi All,
I have this button "Save" to let user to click on the "Save" button to save
the record. When the user clcik on the Save the below error appear.
The error message is:
Compile Error:
Variable Not Defined
When the error message prompt, the code " Cancel = " is highlight.
Below is my code.
Private Sub Save_Claim_Button_Click()
Dim strMsg As String
Dim iResponse As Integer
' Specify the message to display.
strMsg = "Do you wish to save the changes?" & Chr(10)
strMsg = strMsg & "Click Yes to Save or No to Discard changes."
' Display the message box.
iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")
' Check the user's response.
If iResponse = vbNo Then
' Undo the change.
DoCmd.RunCommand acCmdUndo
' Cancel the update.
Cancel = False
End If
I have this button "Save" to let user to click on the "Save" button to save
the record. When the user clcik on the Save the below error appear.
The error message is:
Compile Error:
Variable Not Defined
When the error message prompt, the code " Cancel = " is highlight.
Below is my code.
Private Sub Save_Claim_Button_Click()
Dim strMsg As String
Dim iResponse As Integer
' Specify the message to display.
strMsg = "Do you wish to save the changes?" & Chr(10)
strMsg = strMsg & "Click Yes to Save or No to Discard changes."
' Display the message box.
iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")
' Check the user's response.
If iResponse = vbNo Then
' Undo the change.
DoCmd.RunCommand acCmdUndo
' Cancel the update.
Cancel = False
End If