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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursor position in field on a form

Status
Not open for further replies.

RCorrigan

MIS
Feb 24, 2004
2,872
MT
I have a field with limited entry (25 characters) is it possible to ensure that however the cursor is put into the field (mouse click, tab etc that it is always in position one (i.e. at the very beginning of the 25 characters not half way through) ???

MTIA

<Do I need A Signature or will an X do?>
 
It's a text box

<Do I need A Signature or will an X do?>
 
Often:
With yourFieldName
.SelStart = 0
.SelLength = 0
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

What I meant was ... on a VBA UserForm, an Access Form, a Word Form, an ActiveX control, etc.? but PHV has given you an answer for some of those - if it's not what you need, come back.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Cheers guys , it's on a Word Form : I'll try this and get back later

[cheers]

<Do I need A Signature or will an X do?>
 

In that case, try something like ...
Code:
activedocument.range(selection.Bookmarks(1).Range.Start, _
                     selection.Bookmarks(1).Range.Start).select
... in an OnEntry macro for the field.

Be aware, though, that OnEntry macros only run when you enter the field 'properly' - clicking outside it may result in it being selected but the macro won't run.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top