L
LeAnn
I have an unbound form that is used as a type of worksheet for our users.
They will click on various buttons to enable certain controls to enter
values. Here is a scenario: There are 6 text boxes that enable with one
button. I want to set the focus to the first text box that doesn't have a
value (or the first if they all have values). I have a routine that loops
through the control appropriately unfortunately it doesn't loop through the
controls in the order I need. How can I control the order of the loop - is
that possible? Could I use the tab index to accomplish this? If so, I can't
quite figure out how. Thanks for your assistance........Code example below
Here's what I have so far:
For Each ctrl In Me.Controls
strName = ctrl.Name
If ctrl.ControlType = acTextBox Then
If ctrl.Enabled = True And IsNull(ctrl) Then
ctrl.SetFocus
Exit For
End If
End If
Next ctrl
LeAnn
They will click on various buttons to enable certain controls to enter
values. Here is a scenario: There are 6 text boxes that enable with one
button. I want to set the focus to the first text box that doesn't have a
value (or the first if they all have values). I have a routine that loops
through the control appropriately unfortunately it doesn't loop through the
controls in the order I need. How can I control the order of the loop - is
that possible? Could I use the tab index to accomplish this? If so, I can't
quite figure out how. Thanks for your assistance........Code example below
Here's what I have so far:
For Each ctrl In Me.Controls
strName = ctrl.Name
If ctrl.ControlType = acTextBox Then
If ctrl.Enabled = True And IsNull(ctrl) Then
ctrl.SetFocus
Exit For
End If
End If
Next ctrl
LeAnn