Array... of recordsets?

Alexandre

Registered User.
Local time
Today, 13:08
Joined
Feb 22, 2001
Messages
794
I am looking after a way to automate operation on various recorsets. Is there a way to create a set of recordset (like an array...)? I would like to be able to use a generic name and countable declinations (rcd1, rcd2 or rcd(1), rcd(2), etc...).
 
Concantenate an autonumber field with your generic prefix in a separate field.
 
I'm not sure how efficient it would be but have you considered using a Collection E.g.

Dim colData As New Collection
Dim recData As Recordset
Dim intLoop As Integer

' Create 5 copies of the data
For intLoop = 1 to 5
Set recData = CurrentDb.OpenRecordset("Table")
colData.Add recData
Next intLoop

' Loop through every record of every copy
' displaying the value of the first field
For intLoop = 1 to colData.Count
Do While not colData(intLoop).EOF
MsgBox colData(intLoop).Fields(0).Value
Loop
Next intLoop
 
thanks for the tip on arrays and the use of collections. Now I am beginning to understand - he said for the 20th time today.
 
Kal-el

Thanks for the insight. In fact, I had never used collections so far, but it might well be what I was looking for. I m going to document myself and work a bit on it.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom