Using variable as recordset field name

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I am using Office XP Access and need help using a variable
as a field name in a recordset.

The statement UCase(rs![Funding PE 1]) returns the data in
the field Funding PE 1. I need to use this in a loop and
change the last digit based on the loop index.

All my attempts result in the error message Item not found
in this collection.

How can I use a variable for a field name in the above
statement?

Thanks for any help.
 
Jim said:
I am using Office XP Access and need help using a variable
as a field name in a recordset.

The statement UCase(rs![Funding PE 1]) returns the data in
the field Funding PE 1. I need to use this in a loop and
change the last digit based on the loop index.

All my attempts result in the error message Item not found
in this collection.

How can I use a variable for a field name in the above
statement?

For K = 1 To 10
UCase( rs("Funding PE " & K) )
Next
 
Back
Top