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
Solved

Run qry in order via vba

Posted on 2013-12-05
4
340 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

839 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