"I'd like to loop on all the controls of several existing forms. But Access is using presumably the creation order. How can I change this order to the TAB order without recreating the forms?"
This function will return the .Controls() number according to your tab stop number. You tell it the tab index # you want, and it returns the control # in the controls collection.
It looks for 'live' controls: text boxes, combos, list boxes and check boxes that are enabled, not locked, visible, a tab stop, and in the form detail section.
One caveat: You will need to re-set the tab index numbers on your 'live' controls so they are sequential in an unbroken series, starting from 0. Otherwise, the function may not return a value for every .Controls number.
BTW It returns a Null if there's no answer.
Private Function TabNumber(whichone)
Dim x As Long
With Me
For x = 0 To .Controls.Count - 1
With .Controls(x)
If .Section = 0 Then
Select Case .ControlType
Case acTextBox, acComboBox, acCheckBox, acListBox
If (.TabStop = True) And (.Enabled = True) And
(.Locked = False) And (.Visible = True) Then
If .TabIndex = whichone Then Exit For
End If
End Select
End If
End With
Next x
If x = .Controls.Count Then
' doesn't exist
Else
TabNumber = x
End If
End With
End Function