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

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

Posted on 2008-10-17
4
598 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
  • 2
4 Comments
 
LVL 75

Accepted Solution

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

mx
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 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

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 a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server views 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 Access…
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…

861 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