Solved

Move cursor to end of text

Posted on 2012-03-18
2
301 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
ID: 37734997
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
ID: 37735036
Brilliant

Thank you

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

914 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

23 Experts available now in Live!

Get 1:1 Help Now