MsgBox for 'Record Saved'

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have searched for the answer here, but I guess I have not used the right
combination of words.

Can someone please advise as to how I display a MsgBox when the user clicks
my Save Record command button that says either the Record was successfully
saved or not?

Right now when they click the Save Record button, there is no confirmation
or check to ensure the record was saved.

Thanks in advance.
 
In your OnClick event for the button

on error goto ER
<your save command>
msgbox "Record Saved",vbokonly,"Saved OK"
exit sub
ER:
msgbox "Saved failed: " & err.description,vbokonly,"Save Error"
exit sub

-Dorian
 
Whenever Access saves a record, it fires the AfterUpdate event of the form.
If you really want to be notified whenever it has saved the record
(regardless of how the save happens), add this line:

Private Sub Form_AfterUpdate()
MsgBox "Saved."
End Sub

Note that it also fires the BeforeUpdate event of the *form* before the save
takes place, so if you want to do any validation or checks before the save,
use the Form_BeforeUpdate event.
 
Back
Top