Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Thanked 0 Times in 0 Posts

    Editing within a field (2000)

    When someone tabs to a date field I want the cursor to 'collapse' and start at the beginning of the field, because I have an Input Mask to guide the data entry. I tried using the On Enter event for the control, and creating a SendKeys macro using the keystrokes {F2}{Home}. I can see that the event runs, but the keystrokes don't appear to do anything. Any ideas? Andy.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Editing within a field (2000)

    Try code like this (substitute the appropriate name):

    Private Sub txtSomething_Enter()
    With Me.txtSomething
    .SelStart = 0
    .SelLength = 0
    End With
    End Sub

    Note: the user can set what happens when he/she enters a text box in the Keyboard tab of Tools | Options... See screen shot. This option is a user-level setting, it will apply to all controls on all forms in all databases for that user.
    Attached Images Attached Images

Posting Permissions

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