Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox.selstart 1

Status
Not open for further replies.

andzejek

MIS
Sep 1, 2007
154
US
I have a textbox with imput mask: 99/99/99 for date entry, some "afterupdate" procedure and I want to place currsor always on beginning of the box with "onGetFocus" and textbox.selstart=1 but for some reason it does not work. Cursor stays where is is after clicking. I did try sendkeys "{home}" - this same.

Do you know whot is wrong?
Andrew
 
Do you know whot is wrong?
As you posted NO code, my answer is: NO

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Actually there is no much code related to this control:

Private Sub Text45_GotFocus()

Me.Text45.SelStart = 1

End Sub

and

Private Sub Text45_AfterUpdate()
Dim myStr As String

myStr = Format(Left(Me.Text45.Value, 2) & "/" & Mid(Me.Text45.Value, 3, 2) & "/" & Right(Me.Text45.Value, 2), "long Date")

Me.lbl2.Caption = "On th eday of " & myStr & " ...."

endsub

Thanks
 
for some reason it does not work
What happens ? Any error message ? Unexpected behaviour ? Computer crash ? ... ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
no, just cursor stays where it was placed(click) - I want to move it to the beginning.
 
Hi andzejek,

try on the Click event:

Code:
Me.text45.selstart=0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top