Solved SelStart to textbox Time (1 Viewer)

silentwolf

Active member
Local time
Today, 03:26
Joined
Jun 12, 2009
Messages
575
Hi guys,
I got a textbox with formated time to enter Start time and Endtimes.

The input mask is __:__ on both textboxes

However is there a way of controling that the SelStart is always at the beginning of the textbox even when you click into the textbox?

I like that if the user clicks into the textbox to enter the Starttime he can straight away type the time rather then move the cursor to the front of the textbox.

Cheers

Albert
 

jdraw

Super Moderator
Staff member
Local time
Today, 06:26
Joined
Jan 23, 2006
Messages
15,386
Did you look at the similar threads at the bottom of this page? Richard Horne says he "solved" a similar issue. Check it out-see if it works for you.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:26
Joined
May 7, 2009
Messages
19,246
there are 2 Events you need to add code on the Textbox, Click and GotFocus:

Private Sub StartTime_GotFocus()
Me.StartTime.SelStart = 0
End Sub

Private Sub StartTime_Click()
Call StartTime_GotFocus
End Sub

Private Sub EndTime_GotFocus()
Me.EndTime.SelStart = 0
End Sub

Private Sub EndTime_Click()
Call EndTime_GotFocus
End Sub
 

silentwolf

Active member
Local time
Today, 03:26
Joined
Jun 12, 2009
Messages
575
Sorry did not see that other threads.

Thanks for pointing it out Anrelgp.
It works fine!



Cheers
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:26
Joined
Sep 21, 2011
Messages
14,367
Sorry did not see that other threads.

Thanks for pointing it out Anrelgp.
It works fine!



Cheers
No, you have to post before Similar threads appear. After all, until you post, there is nothing to compare against. :)
However the site does have a pretty good search facility.?
 

silentwolf

Active member
Local time
Today, 03:26
Joined
Jun 12, 2009
Messages
575
Sorry again I did some search online but found just SelStart and did not look in the forum to clearly.

I will do better next time!
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:26
Joined
Sep 21, 2011
Messages
14,367
Sorry again I did some search online but found just SelStart and did not look in the forum to clearly.

I will do better next time!
A lot of the time, Google will point right back here :) , but here is always a good place to start anyway.
 

Users who are viewing this thread

Top Bottom