Solved

vba to run certain queries in sequence ms access 2003

Posted on 2013-11-21
2
752 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
ID: 39666172
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
ID: 39666621
Thank for the feedback experts...

let me test.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

932 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

15 Experts available now in Live!

Get 1:1 Help Now