user3317017
user3317017

Reputation: 1

Error Handling MS Access

Hi what I am trying to achieve is saving a record from a form with error handling:

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

Answers (1)

Gustav
Gustav

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

Related Questions