Boy and girls
I'm doing this:
so it's good
Sub Jump(Key1 As Integer, Frm As Form)
Dim i, NewTabIndex As Integer
With Frm
Select Case Key1
Case 13
NewTabIndex = .ActiveControl.TabIndex + 1
Case 39
If .ActiveControl.SelStart = Len(.ActiveControl.text) Then _
NewTabIndex = .ActiveControl.TabIndex + 1 Else GoTo termino
Case 37
If .ActiveControl.SelStart = 0 Then _
NewTabIndex = .ActiveControl.TabIndex - 1 Else GoTo termino
Case Else
GoTo termino
End Select
If NewTabIndex = -1 Then
NewTabIndex = .Controls().Count - 1
ElseIf NewTabIndex = .Controls().Count Then
NewTabIndex = 0
End If
For i = 0 To .Controls().Count - 1
If .Controls(i).TabIndex = NewTabIndex Then Exit For
Next i
.Controls(i).SetFocus
termino:
End With
End Sub
thanks for your time