Query Errors

R

Roy Goldhammer

Hello there

I have an action query that runs on my access MDB

the action query runs with Docmd.OpenQuery "qryname"

In order not to show messages like "you are going to add 15 records to
table" i add an action DoCmd.SetWarnings False

But, this action also disabled the error messages that could be come from
running the action query

Is there a way to know if an error occur after running the action query?

and is there a way to know which of the records didn't add to the table?
 
A

Alex Dybenko

Roy,
you can use currentdb.querydefs("myquery").execute dbfailonerror
in this can any error with produce a runtime error which you can catch and
show to user
 
G

Guest

hi,
if you want your error messages but don't want the action
query warning do this.
go to Tools>opions>edit/find tab>confirm
uncheck record chages, document deletions and action
querys. you can then comment out the DoCmd.SetWarnings
this will cause access not to display the action query
warning but will display any error messages if they occur
good luck.
 

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