I have a form that has 3 textboxes. I have the tab index set for the flow to go from box 7 to 14 then to 21. What i am trying to figure out is how to basically loop through the text boxes until they are all full. For example, a user inputs info in 14 and 21 but not 7. I would like to have the focus go to box 7 when the user hits enter key. If any of the boxes are empty go to the next empty box in the loop 7-14-21. Then if all boxes are full go to the submit button. I wrote the following code for one of the boxes but i am not sure if i am on the right track. Would this be easier in a select case format? Thank you for your help. -Walker
Code:
Private Sub txtCranSelfResFreq14_AfterUpdate()
If Trim(txtCranSelfResFreq7 & "") And Trim(txtCranSelfResFreq14 & "") And Trim(txtCranSelfResFreq21 & "") <> "" Then
If Trim(txtCranSelfResFreq21 & "") = "" Then
txtCranSelfResFreq21.SetFocus
Else
txtCranSelfResFreq21.SetFocus
End If
Else
btnSubmit.SetFocus
End If
End Sub