Using Variables as part of a Control

G

Guest

I have a database that deals with a number of Offices that populate a number
of text boxes ... I am trying to reuse the code by attatching a variable to
the control
Statement

Me.TextBox_A = xyz
Me.TextBox_B = abc

What I would like to do is Me.TextBox_(Variable) =xyz
Is this possible or am I barking up the wrong tree

I have tried me.TextBox_ & "VarID "and various other permutations... but get
no further

Any help would be gratefully appreciated
 
K

Ken Snell \(MVP\)

Not sure if this is what you seek, but ...

Me.Controls("TextBox_" & VariableName) = xyz
 

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