Undo command loop hole

habbabub

Registered User.
Local time
Today, 14:38
Joined
Jan 24, 2008
Messages
73
i am using
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

in a form
when a user types in anything, but decides not to save. they will click on close..
the :DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
is for the close button but if the user didnt type in anything and simply just wats to look at the record, and clicks on close they will get an error meesage saying "undo is unavaliable" from visual basic. how do u supress this error mesage or get around this?
 
excuse the smily face, it just came up from the code
 
You use error trapping. Search on error trapping.
 
Do MenuItem has been obsolete for years, instead use
If Me.NewRec Then
Me.Undo
Else
EndIf
 

Users who are viewing this thread

Back
Top Bottom