jumping bx textboxes when entering a date

sha7jpm

Registered User.
Local time
Today, 08:08
Joined
Aug 16, 2002
Messages
205
I have a form where the user enters the date of birth into thre seperate text boxes.
day, month & year.

what I am trying to do is get the form to jump from one textbox to the next where the user has typed in
i.e. 01 for the day, the focus jumps to month,
they type 08.. the focus jumps to year ,
the user types 79.

this avoids the user having to press tab or use the mouse to change fields.

I assume I would need something like
if day=(2 char)
month=onfocus.

any ideas?

thanks
John
 
I do not think that there is an event that would know when the user has finished keying each field to know that it should "jump" to the next field.

Why do you not want your users to key the complete date in one field? You can easily set an input mask, create custom validations, ect. to ensure that they are keying a valid date.

Also, I trust that you are not storing two digit year dates. Remember Y2K!

HTH
 
Try putting the following on the On_change for the control(s) you want to assess.

Code:
Static intLetter As Integer
    
    intLetter = intLetter + 1
    
    If intLetter = 2 Then ' Check to see how many letters have been entered.
        Me.tb2.SetFocus
    End If
 
Mark Wild,

Nice job! I love learning a new trick. :D

I was trying the Len() function which odviously did not work.
 
cheers mark & ghudson

Thanks for the code and your help.

we always have our date of births split into dd mm yyyy, so this code works a treat.

many many thanks

John.
 
grand!

Thanks Pat,

that works a treat. It really helps speed up the data entry times for entering Date of births..

many thanks

John.
 

Users who are viewing this thread

Back
Top Bottom