MarkRJackson
asked on
How can I read a DAO recordset record, that has redundunt titles (i.e. [Value_1], [Value_2]) in a loop?
I would like to dynamically assign field names using a counter and loop through the fields of a record in a DAO recordset. Here is an example:
Dim dbs As Database
Dim rs_RIA As DAO.Recordset
DIm wCTR as Integer
Set dbs = CurrentDb
Set rs_RIA = dbs.OpenRecordset("Select * FROM tbl_RIA", DB_OPEN_DYNASET)
wCtr = 1
rs_RIA.movefirst
Do While not rs_RIA.eof
Do While wCtr <= 28
<some variable> = rs_RIA.value_ & wctr
Loop
rs_RIA.movenext
Loop
Is there a way to dynamically set the field name and then retrieve the data from the field?
Dim dbs As Database
Dim rs_RIA As DAO.Recordset
DIm wCTR as Integer
Set dbs = CurrentDb
Set rs_RIA = dbs.OpenRecordset("Select * FROM tbl_RIA", DB_OPEN_DYNASET)
wCtr = 1
rs_RIA.movefirst
Do While not rs_RIA.eof
Do While wCtr <= 28
<some variable> = rs_RIA.value_ & wctr
Loop
rs_RIA.movenext
Loop
Is there a way to dynamically set the field name and then retrieve the data from the field?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER