Solved

vba to run certain queries in sequence ms access 2003

Posted on 2013-11-21
2
792 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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…

728 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