Using a variable as a field name

T

TShirah

How do I tell Access that I am using a variable to name a
field so I cna change fields on the fly: Example
rsEquip![May] = "somevalue" where rsEquip is a
recordset and May is a field name.

strField = Format(Date,"mmm")
rsEquip![Value of strField] = ....
 
T

TShirah

Great! Works like a charm!! Thanks a bunch!
-----Original Message-----
How about ...

rsEquip.Fields(strField)


hth,
--

Cheryl Fischer, MVP Microsoft Access



How do I tell Access that I am using a variable to name a
field so I cna change fields on the fly: Example
rsEquip![May] = "somevalue" where rsEquip is a
recordset and May is a field name.

strField = Format(Date,"mmm")
rsEquip![Value of strField] = ....


.
 

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