?
Solved

Is it possible to loop through the results of a Docmd.OpenQuery

Posted on 2008-10-17
4
Medium Priority
?
626 Views
Last Modified: 2013-11-27
Dim rs as New ADODB.Recordset
rs.Open "SELECT * from tblTest", etc.
Docmd.OpenQuery "qryTest"

Assume that the query qryText does the same query as "SELECT * from tblText".

Obviously, I have kept these very simple.  I know how loop through the rs recordset.  What I don't know is how do I loop through the results of the Docmd?  I know I can copy and past the SQL view from the query, but is there any way to access the results of the Docmd?
0
Comment
Question by:vlvawter
[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
4 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 200 total points
ID: 22745544
Not really. You need to use a Recordset.

mx
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 200 total points
ID: 22745843
OpenQuery opens the query OBJECT in the query designer ... in other words, it doesn't really "run" a query, it just opens up the designer with a particular query. To me, a better name would have been DoCmd.OpenQueryDesign "YourQueryName' ... but the Access team didn't ask me <g> ...
0
 
LVL 75
ID: 22745863
"but the Access team didn't ask me"

Or me either ...

mx
0
 

Author Closing Comment

by:vlvawter
ID: 31507323
Ok, thanks.  I was hoping, but it simply didn't work out.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

752 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