yep you can do this in most cases in VB code. should be lots of
resources online, here is one:
http://allenbrowne.com/ser-23a.html
If you let Access automatically program a command button by going
through the wizard, they will set this stuff up automatically, and you
can manually change the MsgBox.
here is an example of doing this when saving a record.
On Error GoTo Err_btnSaveClose_click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Exit_btnSaveClose_Click:
Exit Sub
Err_btnSaveClose_click:
MsgBox "There was an error while saving this record. blah blah
blah", vbOkOnly
Resume Exit_btnSaveClose_Click