T
Todd Huttenstine
Hey guys
I have a userform. On the form is combobox4. I have a
change event for the combobox and a drpdownclick event for
the combobox. Below is the code in the dropdown event:
ComboBox4.Clear
ComboBox4.AddItem "Select File to Publish"
ComboBox4.AddItem "All Files"
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(TextBox16.Value)
Set fc = f.Files
For Each f1 In fc
ComboBox4.AddItem f1.Name
' s = s & f1.Name
' s = s & vbCrLf
Next
' MsgBox s
This code populates the dropdown box with values. When I
select a value the combobox change event then runs. This
is where the problem happens. Instead of running ONLY the
combobox change event, after it runs it, it then goes back
to the dropdownbutton click event and runs that. Because
it runs it again, it clears out what I just selected in
the combobox. Then the code quits and leaves me with an
empty combobox. How do I fix this?
Todd
I have a userform. On the form is combobox4. I have a
change event for the combobox and a drpdownclick event for
the combobox. Below is the code in the dropdown event:
ComboBox4.Clear
ComboBox4.AddItem "Select File to Publish"
ComboBox4.AddItem "All Files"
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(TextBox16.Value)
Set fc = f.Files
For Each f1 In fc
ComboBox4.AddItem f1.Name
' s = s & f1.Name
' s = s & vbCrLf
Next
' MsgBox s
This code populates the dropdown box with values. When I
select a value the combobox change event then runs. This
is where the problem happens. Instead of running ONLY the
combobox change event, after it runs it, it then goes back
to the dropdownbutton click event and runs that. Because
it runs it again, it clears out what I just selected in
the combobox. Then the code quits and leaves me with an
empty combobox. How do I fix this?
Todd