reddevil1
Registered User.
- Local time
- Today, 06:36
- Joined
- Nov 12, 2012
- Messages
- 92
Code:
Private Sub cmdExitForm_Click()
On Error GoTo Err_cmdExitForm_Click
If MsgBox("Do you want to Save the record?", vbYesNo + vbInformation, "Please confirm:") = vbYes Then
If Me.Parent.Dirty = True Then Me.Parent.Dirty = False
DoCmd.Close
Exit_cmdExitForm_Click:
Exit Sub
Err_cmdExitForm_Click:
MsgBox Err.Description
Resume Exit_cmdExitForm_Click
End Sub
any clues to where i am going wrong?
I have been trying to create correct code for a command button which will ask if the user if he wants to save a record before exit, if the record has not been saved.
hehehe - i have tried so many ways but not been successful. The error message is Block If without EndIf. But i hav erecieved so many other error messages when i try to change the code
