View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Variable Reference to a Form Control

Sharlene,

MyForm.Controls(MYVAR).value

hth,

Doug Glancy

"Sharlene England" wrote in message
...
How do I access my form control, when I don't know the direct name of the
object, but only have it placed in a variable.

I have a form with an object named TEXTBOX3

then I have a variable name MYVAR with a value of TEXTBOX3

if I say TEXTBOX3.value I get the correct result

if I say MYVAR.value then I get an error

How do I refer to TEXTBOX3 using MYVAR?

Thanks.