Article ID: 192196
Article Last Modified on 5/13/2003
Private Sub Command3_KeyPress(KeyAscii As Integer)
Dim Ctrl As Control
Dim FirstTab As Integer
Dim FirstCtrl As Control
Dim Count As Integer
Count = 0
' Loop though all the controls and find
' the last control in the tab order
For Each Ctrl In Controls
If Count = 0 Then
FirstTab = Ctrl.TabIndex
Set FirstCtrl = Ctrl
End If
If Ctrl.TabIndex < FirstTab Then
FirstTab = Ctrl.TabIndex
Set FirstCtrl = Ctrl
End If
Count = Count + 1
Next Ctrl
' Set focus to last control in the tab order
If KeyAscii = 9 Then
FirstCtrl.SetFocus
End If
End Sub
Additional query words: kbDSupport kbDSD kbVBp kbVBp600bug kbVBp500bug kbCtrlCreate
Keywords: kbbug KB192196