StacyStacy
A "Californian" at heart!
- Local time
- Today, 12:52
- Joined
- Jan 29, 2003
- Messages
- 159
I think this is rather simple, but I created an 'undo' button via the wizard. When pressed in the form, it does not work and gives an error msg: "The command or action 'Undo" isn't available now".
Here's my code:
Private Sub cancel_record_and_return_to_menu_Click()
On Error GoTo Err_cancel_record_and_return_to_menu_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Me.Undo
Cancel = True
Exit_cancel_record_and_return_to_menu_Cl:
Exit Sub
Err_cancel_record_and_return_to_menu_Click:
MsgBox Err.Description
Resume Exit_cancel_record_and_return_to_menu_Cl
End Sub
I added the following and it still did not help:
Me.Undo
Cancel=True
Thanks a million!
Here's my code:
Private Sub cancel_record_and_return_to_menu_Click()
On Error GoTo Err_cancel_record_and_return_to_menu_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Me.Undo
Cancel = True
Exit_cancel_record_and_return_to_menu_Cl:
Exit Sub
Err_cancel_record_and_return_to_menu_Click:
MsgBox Err.Description
Resume Exit_cancel_record_and_return_to_menu_Cl
End Sub
I added the following and it still did not help:
Me.Undo
Cancel=True
Thanks a million!