How can I read a DAO recordset record, that has redundunt titles (i.e. [Value_1], [Value_2]) in a loop?
Posted on 2008-10-01
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
Do While not rs_RIA.eof
Do While wCtr <= 28
<some variable> = rs_RIA.value_ & wctr
Is there a way to dynamically set the field name and then retrieve the data from the field?