Replacing a record field by variable

R

RZ

Hi,

I want to replace a record field by a variable

Example

rstRecordSet!RecordField by rstRecordSet!strRecordFieldValue

where strRecordFieldValue = RecordField

I tried different syntax like rstRecordSet! & strRecordFieldValue but it
didn't work

Any idea ?

Thanks
 
B

Brendan Reynolds

rstRecordSet.Fields(strRecordFieldValue)

This assumes that 'strRecordFieldValue' is a string variable containing the
name of the field. (The name 'strRecordFieldValue' seems to me to be a
potentially confusing name for something that contains a field name and not
a field value - or have I misunderstood what you're trying to do here?)
 
Top