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?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top