How to catch in VBA an action query warning?

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top