Solved

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

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

863 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

18 Experts available now in Live!

Get 1:1 Help Now