SteveL13
asked on
Set focus on next field when character count = 5
Is there a way to make a form focus on the text field automatically when the user has entered 5 characters in the previous field?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
check if you have MISSING reference.
the word "sendkeys" should change to SendKeys
the word "sendkeys" should change to SendKeys
ASKER
No missing reference.
Code now:
Private Sub txtHNWRNUM_Change()
If Len(Me.txtHNWRNUM.Text) = 5 Then
SendKeys "{TAB}"
End If
End Sub
Code now:
Private Sub txtHNWRNUM_Change()
If Len(Me.txtHNWRNUM.Text) = 5 Then
SendKeys "{TAB}"
End If
End Sub
is it working?
ASKER
Sorry. No. Still syntax error when I compile and the line, SendKeys "{TAB}", is red.
there is something wrong with your db.
try creating a new blank db
create a form and place two textbox.
place the code in the first textbox and test
try creating a new blank db
create a form and place two textbox.
place the code in the first textbox and test
ASKER
You are not going to believe this one. I had originally copy/pasted the code you send. The SendKeys "{TAB}" was red. I re-typed that line and it works perfectly. Thank you.
ASKER
Perfect! Thank you.
ASKER
sendkeys "{TAB}"
Here's my code:
Private Sub txtHNWRNUM_Change()
If Len(Me.txtHNWRNUM.Text) = 5 Then
sendkeys "{TAB}"
End If
End Sub