How to Run an Append Query in VBA without getting all the messages.

I have a line that runs an append query in my code
DoCmd.OpenQuery "QRY_AppendHeader", acViewNormal, acAdd
the add query Runs normally every time and the only thing I want to avoid is
to stop getting the messages from the application.

"You are about  to run an append query that will modify  data in your table"

"You are about to append 486 rows"

"Microsoft can't append all the records  in the append query"

I know that there are some fields not being Imported I take care of that in the code
but i NEED TO STOP THESE MESSAGES FROM APEARING. hOW DO i DO THAT?
LVL 10
TOPIOAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Data-ManConnect With a Mentor COOCommented:
use the set warnings....

docmd.setwarnings false
docmd.open query....blah blah
docmd.setwarnings true


Mike
0
 
Data-ManCOOCommented:
you could also just use the execute method of the currentdb object

CurrentDb.Execute "QRY_AppendHeader"

you don't need to supress the message as there are none and the execute will run faster than the openquery method of the docmd object.

Mike
0
 
Data-ManCOOCommented:
that was fast.....Mike
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.