Converting string variable to a control name

  • Thread starter Thread starter Guest
  • Start date Start date
If you have the name of a variable in a string variable, you can use it to
refer to a control on the current form in VBA code like this:

Dim strControlName As String
strControlName = "City"
Me(strControlName) = "New York"
 
Another great tip!


Allen Browne said:
If you have the name of a variable in a string variable, you can use it to
refer to a control on the current form in VBA code like this:

Dim strControlName As String
strControlName = "City"
Me(strControlName) = "New York"
 

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

Back
Top