No it doesn't work that way, because I don't know the IDs in advance. I have to loop through all the IDs existing in the table.
It doesn't look I can do it via a single query. The best what I have found so far is to dump the whole recordset to a variant and next work with the variant as an array. I can save time on opening/closing recordsets (only one opening)
Main Topics
Browse All Topics





by: boag2000Posted on 2009-06-23 at 03:34:59ID: 24690525
<I need to loop through all distinct IDs >
ELECT Fld1, Fld2, Fld3, FROM tblInstruments")
You have a "Instruments" table I presume?
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("S
rs.MoveFirst
Do Until rs.EOF
'Do something
rs.MoveNext
Loop
MsgBox "Done."
'Cleanup
rs.Close
Set rs = Nothing
JeffCoachman