kpearson
10-26-2005, 11:59 AM
I am trying to highlight my textboxes, but this peice of code doesn't do it. I have searched posts for similar code and they look very similiar. I tried different ones, but nothing works. Can someone look at this and tell me what is wrong with it?
Thanks
Public Sub Highlight()
With Screen.ActiveForm
If (TypeOf .ActiveControl Is TextBox) Then
.ActiveControl.SelStart = 0 'SelStart specifies the starting position
.ActiveControl.SelStart = Len(.ActiveControl)
End If
End With
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Highlight
End Sub
there are 4 textboxes in a control array.
Thanks
Public Sub Highlight()
With Screen.ActiveForm
If (TypeOf .ActiveControl Is TextBox) Then
.ActiveControl.SelStart = 0 'SelStart specifies the starting position
.ActiveControl.SelStart = Len(.ActiveControl)
End If
End With
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Highlight
End Sub
there are 4 textboxes in a control array.