Hi guys,
I have a command button that no longer seems to work and I'm wondering what is going on.
The button is in a subform linked to a search form, and it's purpose is to undo any changes that the user has made in the subform. Nothing happens when it is clicked, it used to work and I'm not sure what is diferrent now.
Thanks!
-Z
I have a command button that no longer seems to work and I'm wondering what is going on.
The button is in a subform linked to a search form, and it's purpose is to undo any changes that the user has made in the subform. Nothing happens when it is clicked, it used to work and I'm not sure what is diferrent now.
Code:
Private Sub CancelChanges_Click()
On Error GoTo Err_CancelChanges_Click
If Me.Dirty = True Then
If MsgBox("Are you sure you wish to exit without making changes? Any unsaved information will be lost. Please Click OK to Continue or Cancel to Return to the form", vbOKCancel) = vbOK Then
'If ok then undo unsaved changes:
DoCmd.DoMenuItem acFormBar, acEditMenu, acUNDO, , acMenuVer70
'Then close form:
DoCmd.Close
End If
End If
If Me.Dirty = False Then
'If no changes close form:
DoCmd.Close
DoCmd.OpenForm "Main_Page"
End If
Exit_CancelChanges_Click:
Exit Sub
Err_CancelChanges_Click:
Resume Exit_CancelChanges_Click
End Sub
Thanks!
-Z