Solved

Move cursor to end of text

Posted on 2012-03-18
2
303 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
type of query 11 42
Combobox row source 2 20
Access Open Report with SQL Parameter 11 30
Criteria for Date for DCount 4 19
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

776 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