Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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 the
Commend2 labeled "Next" command2 labeled "Back". When I fill in th
first text box and press Enter it automaticly places my curser in th
next text box, and so on. After I fill in the last text box it the
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 t
the next page when pressed or hutting Enter. I have figured out how t
order them using the TabIndex setting, but can't make it auto select th
next command button after hiting enter on the first command button. I
there a way to do this

--
Baf
-----------------------------------------------------------------------
Bafa's Profile: http://www.excelforum.com/member.php...fo&userid=3774
View this thread: http://www.excelforum.com/showthread.php?threadid=57364

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Command button auto select after pressing Enter

maybe something like this

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

--


Gary


"Bafa" wrote in message
...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command button auto select after pressing Enter


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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" wrote in message
...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto filter use with command button deen Excel Worksheet Functions 9 April 22nd 08 10:55 PM
Pressing Enter Key Yo Setting up and Configuration of Excel 4 October 28th 05 10:59 PM
select the first cell in the next row down after pressing enter o. Taffy Setting up and Configuration of Excel 1 March 1st 05 06:06 PM
using 'enter' on a textbox to activate a command button? neowok[_23_] Excel Programming 1 February 25th 04 12:25 PM
Single command button to select one of several choices. Mike Krumel Excel Programming 6 July 18th 03 01:43 PM


All times are GMT +1. The time now is 05:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"