Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / July 2007

Tip: Looking for answers? Try searching our database.

append table data verification

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
B. Meincke - 26 Jul 2007 18:24 GMT
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.

Signature

BJM
ACE Assistant
Gary Allan High School

Jeff Boyce - 27 Jul 2007 18:58 GMT
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

>I have a macro attached to a command button on a form that runs a query
>that
[quoted text clipped - 9 lines]
>
> Thank you in advance for any input or suggestions.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.