I would like to use a variable in a control name in VBA. For example, each of the text boxes below will receive a value based on the results of a DLookup function:
Me.txtboxOverallAvgPassRate_2005
Me.txtboxOverallAvgPassRate_2006
Me.txtboxOverallAvgPassRate_2007
I would like to condense them into one line of code and use a loop to assign the values. Something like:
Me.txtboxOverallAvgPassRate_" & CurrentYear =
Obviously that does not work.
Thanks.
Me.txtboxOverallAvgPassRate_2005
Me.txtboxOverallAvgPassRate_2006
Me.txtboxOverallAvgPassRate_2007
I would like to condense them into one line of code and use a loop to assign the values. Something like:
Me.txtboxOverallAvgPassRate_" & CurrentYear =
Obviously that does not work.
Thanks.