append table data verification

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

Guest

I have a macro attached to a command button on a form that runs a query that
appends a new record to a table compiled from field data collected from a
series of controls on the form.

Is there any user-friendly way I can program the macro to trap errors such
as if the record is not written due to key violations or validation errors,
etc. and present users with one of a pair of message boxes, one if the record
successfully was written to the table and another if was not?

Thank you in advance for any input or suggestions.
 
In general, macros (at least in earlier versions of Access) do not offer
error trapping. To get that, you'd need to use VBA code behind the form.
For example, by using the BeforeUpdate event of a form, you could inspect
the values in various controls on the form and decide whether they were
complete, accurate, ...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top