[AccessD] Iterate through similarlnamed columns in a recordset

Arthur Fuller artful at rogers.com
Fri Jun 10 20:34:21 CDT 2005


You have a table like this (let's not bring up normalisation)...

PK autonumber
Size1 long
Height1 long
Weight1 long

(The last three are repeated 3 times, so their last digits are 2, 3 and 4.)

Assume the required vars are declared and filled. rs = New 
ADODB.RecordSet. etc.
I want to write a loop something like this:

For i = 1 to 4
    debug.print rs("Size"&i)
    etc.
Next

But I can't seem to get it right. I tried using eval() and various other 
approaches. Ideas?

Arthur



More information about the AccessD mailing list