Using a form control name as a variable

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
 
J

Jim Shortslef

Roland,

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

Jim
 
R

Roland Verrinder

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
 
J

Jim Shortslef

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
 
J

Jim Shortslef

Roland,

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

Thanks for the help.

Jim
 

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