Unlike VB, Access forms do not support control
arrays.
A control array is a group of controls that share the same
name and type. They also share the same event procedures. A control array has at least one
element and can grow to as many elements as your system resources and memory permit; its
size also depends on how much memory and Windows resources each control requires.
We can create an array of controls, but not a control array.
One workaround is to append a number as a suffix to all similar controls. For
example, if we had controls named "txtUser1", "txtUser2",
"txtUser3"......"txtUser10", then we could refer to all these controls
from a loop as
Dim intI as integer
For i=1 to 10
debug.print me("txtUser"& cstr(i)).Name
Next
|