Solved

vba to run certain queries in sequence ms access 2003

Posted on 2013-11-21
2
740 Views
Last Modified: 2013-11-22
Hi Expert's

I need a macro in ms access 2003 to run in total 10 different queries in a sequence. ..and I have no idea on how to write the vba...

most of the qry are select and append queries..

I am looking create a button on a userform to complete the task.
0
Comment
Question by:route217
2 Comments
 
LVL 4

Accepted Solution

by:
AccessGuy1763 earned 500 total points
Comment Utility
Do you need to display the queries in any way?  The simplest way would be something like this:

Private Sub cmdMyButton_Click()

   'Optional turn warnings off
   docmd.setwarnings false

   'Run 10 queries
   docmd.runsql "yourQueryName1"
   docmd.runsql "yourQueryName2"
   docmd.runsql "yourQueryName3"
   ...

   'Optional turn warnings back on
   docmd.setwarnings true

End Sub

Open in new window

0
 

Author Comment

by:route217
Comment Utility
Thank for the feedback experts...

let me test.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

11 Experts available now in Live!

Get 1:1 Help Now