I have a data entry form with 9 buttons that has been getting buggy.
Attachment 43649
The first step is to retrieve a record.
Then change a value.
The Undo button undoes the record as it's supposed to, then locks all the buttons. I have no idea what's causing the buttons all to lock.
Here's what's really strange. The only way I have found to escape is to right click on the form and select Close.
When I do this, the form does not close, but the buttons are enabled. Which brings us back to doe.
Here's the code that runs when the Undo button is clicked.
Code:
Private Sub cmdUndo_Click()
On Error GoTo Err_cmdUndo_Click
If Me.Dirty Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acUndo, , acMenuVer70
End If
Exit_cmdUndo_Click:
Exit Sub
Err_cmdUndo_Click:
MsgBox Err.Description
Resume Exit_cmdUndo_Click
End Sub
Oddly enough this code on the Exit button works fine.
Code:
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
If Me.Dirty Then
If MsgBox("Do you wish to save this record?", vbYesNoCancel, "Save Record") = vbNo Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
ElseIf IsNull(Me.Region) Then
MsgBox "Please select a region."
GoTo Exit_cmdExit_Click
End If
Else
DoCmd.Close
End If
Exit_cmdExit_Click:
Exit Sub
Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click
End Sub
Private Sub