Solved

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

Posted on 2004-09-21
3
396 Views
Last Modified: 2012-08-13
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?
0
Comment
Question by:TOPIO
  • 3
3 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 300 total points
ID: 12118593
use the set warnings....

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


Mike
0
 
LVL 18

Expert Comment

by:Data-Man
ID: 12118600
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
 
LVL 18

Expert Comment

by:Data-Man
ID: 12118603
that was fast.....Mike
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question