setting cursor position?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I set the tex-box cursor position in code? Like I want to set the
position to the beginning of the text in one situation, but set it to the end
in another situation.

I suspect that it can be done with DoCmd but I can't seem to find the right
combination for the DoCmd.

I realize that it can be set with the menu via the tools, options, etc ....
but I need to do it under program control.

Thanks in advance.
 
Take a look at SelText, SelLength, and SelStart functions.

If you need more help than that post back.
 
When I try to compile, the debugger stops @ "selstart" and indicates it needs
a reference. I have VB for Applications referenced.
Any thoughts on why that should hang?
Thank you,
Karl
 
PMFJI, but I think you really should consider having Area Code as a separate
field, rather than concatenating them together.

Having gone through a number of area code splits, it's much easier that
way...
 
SelLength indicates how many characters following SelStart should be
selected.

Don't be afraid to experiment with different values: it's not going to hurt
your application!

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


boomer said:
I got the code to perform this task from a Microsoft support page and it is
as foollows:
'This code positions the cursor to the right of the
'area code automatically.
'Article is entitled "Access 97/2000: Phone Number Input
'with Default Area Code
Me![PhoneNumber].SelStart = 5
Me![PhoneNumber].SelLength = 1
I understand (I think) that the cursor will start at the 5th position over
which will be right after the default area code, but I do not understand
the
SelLength value of 1.
Can you help again.



--
Boomer


Douglas J. Steele said:
PMFJI, but I think you really should consider having Area Code as a
separate
field, rather than concatenating them together.

Having gone through a number of area code splits, it's much easier that
way...
 
Back
Top