I have some text boxes with code that I need to keep running as long as I am in that text box. The user would click on a text box and select their object (in the application). After selecting the object, the user shouldn't have to click on the text box again to select a different object if they so choose to. Also, the user should have the freedom to select a different text box (which would have the same type of code, with minor variances). My first attempt was something as shown below in pseudo code.

textboxA_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

   Do While selected object count < 2
      DoEvents
       *Process Selection*
      If valid selection then
         display information about selection on form
      End If
      Exit Do
   Loop

   TextBoxA_MouseUp 1, 0, X, Y

End Sub
This type of code would be used for textboxB with some differences in the Process Selection bit. Setting focus to the text box won't work since it does not trigger the Do While loop. I would need some way to run the Do While loop again, even after a valid selection. Maybe I need to nest the Exit Do in an If Then that checks to see if any of the other text boxes have the ActiveControl.TabIndex. If the condition is true, then I exit the current mouse event sub. The question I have with this is that once I click on another text box, will I get moved to that text box before I'm able to make a decision based on the ActiveControl.TabIndex value?