Code:
Dim Fields As Control
For Each Fields In Me.Controls
If Fields.ControlType = acComboBox Then
FieldsOnthisForm = FieldsOnthisForm & "," & Fields.Name & "'" & Fields.Value & "', "
End If
Next Fields
MsgBox FieldsOnthisForm
Hello Friends,
I am trying to loop through all the controls on a form to capture their names and values to insert them on a table using SQL. When I executed the above codes, the order is messed up. The first control the code looped was in the middle of the form. I am wondering what controls the order? I tried tab order, didn't work.
Thank you!
Allan