query rows

S

smk23

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!!
 
O

Ofer

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
 
S

smk23

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
 
F

FGM

How do I post a question it will only let me into reply?????? Sorry to do it
this way help..
thanks...
 
A

Allen_N

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.
 
Top