Variable with rst!

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

Thanks for taking the time to read my question.

I would like to use a variable that holds the field name
instead of using the actual field name when using rst!

For example.

Instead of rst!Field1

I'd like

Dim VarName As String
VarName = "Field1"
rst!VarName

Unfortunately this doesn't work.

Does anyone know how to make this work?

Thanks,

Brad
 
Thanks so much Allen!

It worked Perfectly!

Brad
-----Original Message-----
Try:
rst(VarName)

That's actually interpreted as:
rst.Fields(VarName)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top