Reputation: 1
Hi what I am trying to achieve is saving a record from a form with error handling:
MSGBOX "Success! Do you want to add a new record?" [Yes/No] form is saved.
New record, clear field Me.Serial
What i have tried so far is:
On Error GoTo Err_cmdCloseForm_Click8
DoCmd.RunCommand acCmdSaveRecord
MsgBox "item successfully checked out"
DoCmd.Close
Exit_cmdCloseForm_Click:
Exit Sub
Err_cmdCloseForm_Click8:
MsgBox "Save was unsuccessful, please try again", vbInformation, "Warning"
Resume Exit_cmdCloseForm_Click
Field [Serial] is required, yet when i click save with no information entered into any field i receive a success message. Any thoughts or links would be greatly appreciated.
Regards
J
Upvotes: 0
Views: 77
Reputation: 55816
Use the BeforeUpdate event to validate and possibly to prevent an update, and the AfterUpdate event to display a confirming message.
Upvotes: 1