Hi,
You can make an array of controls too:
Dim mc( 1 to 5 ) As Control
Dim i as long
For i = 1 to 5
Set mc(i) = Me.Controls("Combo" & i )
Next i
Assuming the controls are carefully designed to be called Combo1, Combo2,
Combo3, ... Using the array of controls then avoid the concatenation, in
this case. In general, if you are not in ...control... of the design, you
may cycle through the controls collection:
Dim myCombos As New Collection
Dim c As Control
For Each c In Me.Controls
If TypeOf c Is ComboBox Then
myCombos.Add c
End If
Next c
and then, myCombos would be a collection made of just your combos.
myCombos(i) would then be able to retreive the i-th combo box ( just take
care to have the right scope for the variable myCombos).
Hoping it may help,
Vanderghast, Access MVP