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

Memo Field - Positioning the Cursor 1

Status
Not open for further replies.

LarryDeLaruelle

Technical User
May 19, 2000
1,055
US
I have a memo field on a tab control.

When the user clicks on the 'Notes' tab, I would like the cursor to be placed at the end of the existing entry/ies so the user can begin typing the next entry.

Currently, it highlights/selects the entire entry and, of course, the first key stroke deletes the selection.

Is there a simple (or even a not-so-simple) solution to this?

Using Access 2K.

Thanks.

Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Hi LarryDeLaruelle,

This should work ok for the On Got Focus event of the MemoField:
On Error Resume Next
Me!MemoField.SelStart = Len(Me!MemoField) + 1


Bill
 
Bill:

Thanks again. That did the trick.

I had thought that there was a property that could be set to do this. Was I dreaming or was it in Access97?



Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Larry,

you may be thinking of the option to go to the start of the field via the keyboard. That's found under Tools>Options>Keyboard Tab and selecting Goto Start of Field under Behavior entereing field.

Sound right?

-Patrick

Nine times out of ten, the simplest solution is the best one.
 
Patrick:

Thanks, that was it.

I had thought there was a property such as that which could be set for individual controls.

Guess not; however, Bill's solution works perfectly.


Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top