append table data verification

B

B. Meincke

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.
 
J

Jeff Boyce

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top