Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox_change event problem
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????? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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????? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox_change event problem
Thank you, I hadn't thought of that!!! Worked great!
"sebastienm" wrote: 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????? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WB before save event problem | Excel Programming | |||
problem with beforeclose event | Excel Programming | |||
ComboBox_Change sub runs unexpectedly | Excel Programming | |||
Problem with SheetCalculate Event | Excel Programming |