Solved

Move cursor to end of text

Posted on 2012-03-18
2
300 Views
Last Modified: 2012-03-18
Hi All

I have a subform in single form mode that has a note field. Because I have enter behavior set to highlight field when I move between records,  the whole of the note fields text is highlighted. This means that if someone accidentally presses a key on the keyboard the whole note field is deleted to allow new data to be entered. I don't want to alter the default enter behavior because it is usefull elswhere and I don't want to set the focus to another field because that will be highlighted and suffer the same problem.

So what I need in the OnCurrent property of the subform is
If "Notes" (The Note Control)  has focus then move cursor to end of field or text.
0
Comment
Question by:DatabaseDek
2 Comments
 
LVL 16

Accepted Solution

by:
kmslogic earned 500 total points
Comment Utility
On the Enter event of your textbox that contains your notes (which gets fired when you enter the field) do this:


private sub tbMyField_Enter()
     me.tbMyField.SelStart = me.tbMyField.SelLength
end sub

Open in new window

0
 

Author Closing Comment

by:DatabaseDek
Comment Utility
Brilliant

Thank you

(Where do you learn this stuff?) I spent an hour looking for it!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now