Input mask partially filled in (1 Viewer)

cpampas

Registered User.
Local time
Today, 09:04
Joined
Jul 23, 2012
Messages
218
Hi
I have an unbound control in my form to enter a string in time format, for that I set the input mask of the control to 00:00;0;_
Is there a way to just enter the hours part of the string in case it is the top of the hour ?

18:30 In this case I would have to enter the 4 characters of the string
18:00 In this case I would only type 18, the rest would be assumed if not entered

I would appreciatte your help
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:04
Joined
Oct 29, 2018
Messages
21,456
Hi. I rarely use an input mask. Maybe you could try using a format instead.
 

bob fitz

AWF VIP
Local time
Today, 17:04
Joined
May 23, 2011
Messages
4,719
Try the following code in the "GotFocus" event of the textbox:
Me.TxtBoxName.SelStart = 0
Me.TxtBoxName.SelLength = Len(Me.TxtBoxName.Text) - 3
Replace TxtBoxName with the name of your textbox control
 

cpampas

Registered User.
Local time
Today, 09:04
Joined
Jul 23, 2012
Messages
218
hi Bob,
What you suggested plus setting the default value of the text box to "00:00" worked just great
Thanks a lot
 

Users who are viewing this thread

Top Bottom