How to catch in VBA an action query warning?

L

Len

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

Ofer

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
 
Top