Using Variables as part of a Control

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Not sure if this is what you seek, but ...

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