Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Run qry in order via vba

Posted on 2013-12-05
4
Medium Priority
?
354 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
[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
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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