Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem managing Enter Key behavior in a userform

I have a userfrom that contains three combo box lists and 8 text boxes.

My user uses the comboboxes to select from lists of values. They then enter
data in to the text boxes.

Finally they select a save command button to save all the data to a row in a
worksheet.

I have set the tab order to go through the three combo boxes first then the
text boxes. I have set the Text box EnterKeyBehavior proprty to False.
Everything is fine if the user uses a mouse or the Tab Key.

My problem is that if the user presses the Enter Key at any time the
comboboxes are live the form immediately trys to Save. I want the Enter key
behavior for the combo boxes to set focus to the next combobox or Text box
but when I use the following code all that happens is I cannot edit the
initial combobox, focus immediately goes to the one referenced in the code

Private Sub cbbLocation_Enter()
cbbFYear.SetFocus
End Sub

Any help would be appreciated.
Thanks
Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Problem managing Enter Key behavior in a userform

One possibility owul be to have the SAVE Button set to:
CommandButton1.enabled = false
UNTIL ALL Comboboxes and Textboxes contain values.
You could use the :
CommandButton1.enabled=True on the last Textbox to enable it again.

Corey....
"belerephone" wrote in message
...
I have a userfrom that contains three combo box lists and 8 text boxes.

My user uses the comboboxes to select from lists of values. They then
enter data in to the text boxes.

Finally they select a save command button to save all the data to a row in
a worksheet.

I have set the tab order to go through the three combo boxes first then
the text boxes. I have set the Text box EnterKeyBehavior proprty to False.
Everything is fine if the user uses a mouse or the Tab Key.

My problem is that if the user presses the Enter Key at any time the
comboboxes are live the form immediately trys to Save. I want the Enter
key behavior for the combo boxes to set focus to the next combobox or Text
box but when I use the following code all that happens is I cannot edit
the initial combobox, focus immediately goes to the one referenced in the
code

Private Sub cbbLocation_Enter()
cbbFYear.SetFocus
End Sub

Any help would be appreciated.
Thanks
Peter



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
irrational userform/combobox behavior Jacob Excel Programming 3 October 13th 06 12:43 PM
Odd UserForm Behavior Gene Excel Programming 8 August 4th 06 04:10 AM
Changing Behavior of the <Enter Key? DCSwearingen Excel Discussion (Misc queries) 4 April 25th 06 03:23 PM
modify the behavior of the enter key? BobW Excel Programming 0 January 30th 06 03:06 PM
Enter Key behavior with Userforms Lance Excel Programming 3 June 18th 04 09:22 PM


All times are GMT +1. The time now is 01:50 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"