+ Reply to Thread
Results 1 to 4 of 4

Command button auto select after pressing Enter

  1. #1
    Registered User
    Join Date
    08-18-2006
    Posts
    43

    Command button auto select after pressing Enter

    I have a user form with 5 text boxes to fill in and 3 command buttons. Command1 button that needs to be pressed for a function and then Commend2 labeled "Next" command2 labeled "Back". When I fill in the first text box and press Enter it automaticly places my curser in the next text box, and so on. After I fill in the last text box it then auto selects the Command1 button which perfoms a function for the user. But it does not go ahead to command2 button, which would take them to the next page when pressed or hutting Enter. I have figured out how to order them using the TabIndex setting, but can't make it auto select the next command button after hiting enter on the first command button. Is there a way to do this?

  2. #2
    Gary Keramidas
    Guest

    Re: Command button auto select after pressing Enter

    maybe something like this

    Private Sub CommandButton1_Click()
    Me.CommandButton2.SetFocus
    End Sub

    --


    Gary


    "Bafa" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I have a user form with 5 text boxes to fill in and 3 command buttons.
    > Command1 button that needs to be pressed for a function and then
    > Commend2 labeled "Next" command2 labeled "Back". When I fill in the
    > first text box and press Enter it automaticly places my curser in the
    > next text box, and so on. After I fill in the last text box it then
    > auto selects the Command1 button which perfoms a function for the user.
    > But it does not go ahead to command2 button, which would take them to
    > the next page when pressed or hutting Enter. I have figured out how to
    > order them using the TabIndex setting, but can't make it auto select the
    > next command button after hiting enter on the first command button. Is
    > there a way to do this?
    >
    >
    > --
    > Bafa
    > ------------------------------------------------------------------------
    > Bafa's Profile:
    > http://www.excelforum.com/member.php...o&userid=37748
    > View this thread: http://www.excelforum.com/showthread...hreadid=573644
    >




  3. #3
    Registered User
    Join Date
    08-18-2006
    Posts
    43
    Thanks again Gary. My project is coming together nicely. Hopefully I will have it completed by tomorrow and can take it to my interview for a promotion Wednesday.

  4. #4
    NickHK
    Guest

    Re: Command button auto select after pressing Enter

    For these controls, you have a few option to make life easier for the user.

    ..TabStop=True - Included in the cycle of controls (order determined by
    TabIndex) when Tab is pressed.
    ..Default=True - Simulate a click on this control when Enter is pressed
    ..Cancel=True - Simulate a click on this control when Esc is pressed

    NickHK

    "Bafa" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Thanks again Gary. My project is coming together nicely. Hopefully I
    > will have it completed by tomorrow and can take it to my interview for
    > a promotion Wednesday.
    >
    >
    > --
    > Bafa
    > ------------------------------------------------------------------------
    > Bafa's Profile:

    http://www.excelforum.com/member.php...o&userid=37748
    > View this thread: http://www.excelforum.com/showthread...hreadid=573644
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1