Jump from one textbox to another

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

Is it possible when user enters date in date1 textbox cursor
automatically jump to date2 text box. My settings are as follows:

input mask 00/00/00
format property mm/dd/yy

Thank You.
 
you can perhaps determine the length of the string inputted in date1.
and set the focus to the dat2 field as soon as all numbers are filled
in at the dat1 field

(in afterupdate_dat1 sub)
if len(me.dat1.value)=6 then
me.dat2.setfocus
endif
 
On after update event of your first textbox set the focus to the other
textbox as
Me.NameOfTextBox2.SetFocus
 
when i run the script in debug mode Len(Me.Date1.Value), it shows null.

If Len(Me.Date1.Value) = 6 Then
Me.Date2.SetFocus
End If

---------------------------------------------------
 
If you want to try Toine's suggestion, use Text property:

If Len(Me.Date1.Text) = 6 Then
Me.Date2.SetFocus
End If
 
If a textbox has an input mask, you can just set its Autotab property to
make the focus jump to the next control in tab order when the user has
typed enough characters to "fill" the input mask.
 

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