Re: set focus to the beginning of the text box

alicejwz

Registered User.
Local time
Today, 14:53
Joined
Jul 9, 2003
Messages
91
Re: set focus to the beginning of the text box

Hi all,

I have a text box with an input mask property set. when you click on the text box it focuses the last character of the control. Is there a way to get it to go the beginning of the control(first character in the text box)?
I tried Me!work_ord_num.SelStart but I received an error
VB error: Object doesn't support this property or method.

Thanks!
 
alicejwz said:
Is there a way to get it to go the beginning of the control(first character in the text box)?
I tried Me!work_ord_num.SelStart but I received an error
VB error: Object doesn't support this property or method.

See what happens when you don't use prefixes to differentiate between a field and an object bound to the field?

Try changing the name of the textbox to txtWorkOrdNum and then change the code to:
Code:
Me.txtWorkOrdNum.SelStart = 1
 
Re: set focus to the beginning of the text box

hi,

you need to setfocus before using .SelStart property

exmpale:

txtWorkOrdNum.SetFocus
txtWorkOrdNum.SelStart = 0

good luck.
 

Users who are viewing this thread

Back
Top Bottom