S
scott
I have a 6 comboboxes(control toolbox) on a worksheet. All of these
boxes have a KeyDown event associated with them used to navigate
around the sheet with the TAB and ENTER keys. 4 of them also have a
LostFocus event. When I navigate from one particular
combo(cboPersArea) of those 4 to any of the other 3, my code runs but
seems to ignore the fact that I turn off the screen updating. This
only occurs when moving from the cboPersArea and does not occur if
moving to either of the combos without their own Lost Focus Events.
I assume it something to do with the code behind cboPersArea so here
it is:
___________________________________________
Private Sub cboPersArea_KeyDown(ByVal KeyCode As
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyTab Or KeyCode = vbKeyReturn Then
cboReasonForOpening.Activate
End If
End Sub
_________________________________________
Private Sub cboPersArea_LostFocus()
code = cboPersArea.Value
cboCostCenter.Value = ""
FindData
End Sub
___________________________________________
The FindData procedure resides in Module1 and works fine except when
moving to another combobox with a lost focus event on it. I will put
that code in the first reply so that it doesn't get in the way here. I
tried using the CHANGE event for the combos originally but the user
could only type one letter in to the combo and the change event would
take over. I keep thinking this is simple but its getting late and my
mind doesn't want to fuction anymore.
Help Please!
boxes have a KeyDown event associated with them used to navigate
around the sheet with the TAB and ENTER keys. 4 of them also have a
LostFocus event. When I navigate from one particular
combo(cboPersArea) of those 4 to any of the other 3, my code runs but
seems to ignore the fact that I turn off the screen updating. This
only occurs when moving from the cboPersArea and does not occur if
moving to either of the combos without their own Lost Focus Events.
I assume it something to do with the code behind cboPersArea so here
it is:
___________________________________________
Private Sub cboPersArea_KeyDown(ByVal KeyCode As
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyTab Or KeyCode = vbKeyReturn Then
cboReasonForOpening.Activate
End If
End Sub
_________________________________________
Private Sub cboPersArea_LostFocus()
code = cboPersArea.Value
cboCostCenter.Value = ""
FindData
End Sub
___________________________________________
The FindData procedure resides in Module1 and works fine except when
moving to another combobox with a lost focus event on it. I will put
that code in the first reply so that it doesn't get in the way here. I
tried using the CHANGE event for the combos originally but the user
could only type one letter in to the combo and the change event would
take over. I keep thinking this is simple but its getting late and my
mind doesn't want to fuction anymore.
Help Please!