PDA

View Full Version : Using a Variable in MyRecordset.Fields![Variable]



Mavila
01-28-2013, 07:56 PM
I've tried:
MyRecordset.Fields![strVar]
MyRecordset.Fields!['strVar']
MyRecordset.Fields!['" & strVar & "']
MyRecordset.Fields(strVar)

None of those work. I get, "Item cannot be found in the collection corresponding to the requested name or ordinal" which I'm assuming means that it's not reading the variable as a field name. The value of the variable is correct, so my syntax is off I think.

Anyone got the key to this?

Mavila
01-29-2013, 08:19 AM
Guess I'll have to scrap this approach.:(