Solved

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

Posted on 2004-09-21
3
388 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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 …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now