query rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry, that last post got away from me.
Can I loop through the rows returned by a query with a "For Each" routine?
Are the rows a collection or can I define an array? How to?

Thanks!!
 
I'm not sure that what you are looking for, you can loop through a query by
openning a record set.

Dim MyDB As Dao.DataBase, MyQuery As Dao.RecordSet
Set MyDb = CurrentDb
Set MyRec = MyDb.OpenRecordSet ("Select * from QueryName")
While Not MyRec.Eof
.......
MyRec.MoveNext
Wend
 
Thanks, Ofer. That got it.
--
sam


Ofer said:
I'm not sure that what you are looking for, you can loop through a query by
openning a record set.

Dim MyDB As Dao.DataBase, MyQuery As Dao.RecordSet
Set MyDb = CurrentDb
Set MyRec = MyDb.OpenRecordSet ("Select * from QueryName")
While Not MyRec.Eof
.......
MyRec.MoveNext
Wend
 
How do I post a question it will only let me into reply?????? Sorry to do it
this way help..
thanks...
 
If you mean, "How do I post a question? It will only let me into 'reply'.",
then you need to press the "New" button to the left of the "Reply" button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top