View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
sebastienm sebastienm is offline
external usenet poster
 
Posts: 694
Default Combobox_change event problem

Hi,
You could use a variable to track whether the event should be processed or
not:
'form level variable
Private ProcessingOk as boolean

'in your CmdOk_Click sub, set processingOk
Sub CmdOk_Click( )
ProcessingOk=True
' ... processing code here
ProcessingOk = False
End Sub

'in your other controls event subs, process only if Not OrocessingOk.
'Eg
Sub combobox_change ( )
If Not ProcessingOk Then
'your regular code here
End if
End Sub

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Shawn G." wrote:

I have a form that uses a combobox to fill in the textboxes on the form to be
edited using the change event. Work great but when the text boxes are all
edited and the user press the OK button to copy the fields to the worksheet
as soon as it gets to the first
.cells(4, 1).Value = frmEditText.txtbxName.Value
It immediatley goes to the combobox_change event, which resets the form.
Any way around this or a way to turn off the combobox_change event
temporarily while the code fills in the proper cells?????