Using a form control name as a variable

  • Thread starter Thread starter Roland Verrinder
  • Start date Start date
R

Roland Verrinder

Hi Jim,

You first refer to the control named Loc01 then to the
variable string "Loc1". Does a control named Loc1 exist on
the form?

Roland
 
Roland,

Yes I have a control on my form named Loc01. I want to
use a variable for the control name.

Jim
 
Jim,

I understand what you want to do and the method should
work. The point I am making is the different control
name "Loc1", instead of the explicit name "Loc01" you
first used.

If you don't have a control (with a ControlSource
property) named "Loc1" on your form, you will certainly
get an error.

Roland
 
Roland,

I still get the same error even when I corrected the
control name to "Loc01" Loc01 is the name of a control
on my form.

Jim
 
Roland,

The problem ended up being the variable name that I was
using.

Thanks for the help.

Jim
 
Back
Top