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"
 
Back
Top