Move to next field from full text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have lurked here for years and gained valuable skills, many thanks.
However, I have a need to be able to go to the next text box in a data entry
screen when the first text box is full, without having to hit enter. I saw
the post about doing it with a combo box (Me.[TextBoxName].SetFocus), but I
can't get it to work by just filling the field. It may not be possible in
Access, but if you know how, please come forth.

Best regards
 
The control's AutoTab property (set to Yes) is what you're thinking of, but
if I remember correctly it only work's if you have an Input Mask set for the
control that limits the maximum number of characters that can be entered.

Bill said:
I have lurked here for years and gained valuable skills, many thanks.
However, I have a need to be able to go to the next text box in a data entry
screen when the first text box is full, without having to hit enter. I saw
the post about doing it with a combo box (Me.[TextBoxName].SetFocus), but I
can't get it to work by just filling the field. It may not be possible in
Access, but if you know how, please come forth.

Best regards
 
I figured out a workaround without having to use an Input Mask; I personally
hate them!

Private Sub YourTextBoxName_Change()
If Len(Me.YourTextBoxName.Text) = X Then NameOfNextControl.SetFocus
End Sub

Where X is the number of characters allowed in the textbox and
NameOfNextControl is the name of the control you want to receive focus next.
 
Thanks very much, that worked a treat! I tried the LEN() approach, but with
key stroke, not change; I didn't think of delaying the "on change" through
the If statement. You Rock!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top