Assigning Values

  • Thread starter Thread starter Gary Robinson
  • Start date Start date
G

Gary Robinson

Hi All

I have a question, i have a form with loads of text boxes on it, i have some
code that will be used for each textbox in a sepertae sub procedure. The
question i have is, can i specify in a string which textbox is to be
altered. I can do this normally by typing in each one seperatley, but i'm
looking for an easier way. Hope this makes sense.

Thanks in advance


Gary
 
can i specify in a string which textbox is to be
altered.

strControlName = "txtAlpha"


Set ctlMyControl = Me.Controls(strControlName)


Me.Controls(strControlName).BackColor = vbRed



etc


Hope that helps


Tim F
 

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