To reference a control by variable:
Me.Controls(var)
or
Form_frmName.Controls(var)
Control properties may be used with this reference also (Me.Controls(var).Name).
You can use a similar method for referring to a form or report by variable.
CurrentProject.AllForms(var).Name
CurrentProject.AllReports(var).Name
Forms(var) and Reports(var) refer to currently open forms or reports respectively.
Note that var can be an integer (index variable) or a string (name).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.