Results 1 to 4 of 4

Thread: what am I missing?

  1. #1

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249

    Question

    I am creating a password protection form. I want to be able to press enter right after typing the last character of the password instead of having to tab to the 'continue' button. How do I do that?

    Also, if the password that they type is incorrect, how do you highlight the entire textbox where you type the password into so that you don't need to delete what you mistyped?

    smh

    (One of those days....)
    Normal is boring...

    smh

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176
    Set the Default property of the Continue button to True, then enter will active the buttons Click event.

    USe the Textbox's SelStart and SelLength properties to Highlight the text, i.e.
    Code:
        Text1.SetFocus
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1)

  3. #3
    Code:
    Private Sub txtPassword_GotFocus()
      On Error Resume Next
      SendKeys "{Home}+{End}"
    End Sub

  4. #4

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249

    thanks

    Thanks, Aaron...worked great!
    Normal is boring...

    smh

Posting Permissions

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



Click Here to Expand Forum to Full Width