How to catch in VBA an action query warning?

G

Guest

I am running an append query from VBA using DoCmd command. Sometimes I am
getting a message: “Microsoft Access can’t append all records in the append
query†(due, for example, to key violations) and no error is generated. I
want to be able to handle such situation through VBA. Is there way of doing
that?
Thanks.
 
G

Guest

I'm not sure if that what you are asking for, but if you want to remove the
message, then use this

Docmd.SetWarnings False
Docmd.OpenQuery "QueryName" ' or runsql
Docmd.SetWarnings True
 

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