View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
belerephone belerephone is offline
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