Variable with rst!

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
 
G

Guest

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.




.
 

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