Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting Cursor to Start of Memo Field (2000 and 2003)

    I have a memo field on a form. Many of the users I support have their Access Keyboard Options set to Select Entire Field when they enter a field. This means when they tab into the memo field, all their previous comments are selected. They panic, hit the space bar thinking their comments will be unhighlighted and lose the comments (they don't think about Edit | Undo or something else to get them back before typing something else).

    Is there a way to put something in the On Enter or On Got Focus event (or both) to force the cursor to the beginning of the text box and over-ride their Access default?

    Thanks!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Cursor to Start of Memo Field (2000 and 2003)

    Yes, say that the text box is named txtMemo. Create an On Enter event procedure:

    Private Sub txtMemo_Enter()
    With Me.txtMemo
    .SelStart = 0
    .SelLength = 0
    End With
    End Sub

    If you'd rather postion the insertion point at the end of the text, use

    .SelStart = Len(.Text)

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting Cursor to Start of Memo Field (2000 and 2003)

    Perfect! I knew it had to be reasonably easy.

    I appreciate your help.

    Nancy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •