Solved

Run qry in order via vba

Posted on 2013-12-05
4
333 Views
Last Modified: 2013-12-05
Hi Expert's using access 2003

I am trying to automate using the following vba a macro to run the following qys in order..

private sub cmdmybutton ()

Docmd.setWarnings False

Docmd "03 qry_apples"
Docmd "04 qry_oranges"

Docmd.setWarnings True
End Sub

in total I have 11 qry...not sure what I am doing wrong..step by step 8nstruction woukd be great in order to learn.

Bssically I want to call the qry's if its possible in access 2003.
0
Comment
Question by:route217
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39697837
Your code is close... you just need to use the OpenQuery method


private sub cmdmybutton ()

Docmd.setWarnings False

Docmd.OpenQuery  "03 qry_apples"
Docmd.OpenQuery "04 qry_oranges"
' etc... repeat for all your queries

Docmd.setWarnings True
End Sub

Open in new window

0
 

Author Comment

by:route217
ID: 39697841
Excellent thanks always good to learn
0
 

Author Comment

by:route217
ID: 39697863
Hi mbizup

just testing the code getting a run time error 7874...saying microsoft office can't find the qry
0
 

Author Comment

by:route217
ID: 39697869
Forgot to mention my qry's are in  folder call end to end process in Group left hand plane once access opens up..
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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

947 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

21 Experts available now in Live!

Get 1:1 Help Now