Combo Box Changes When Opening Workbook

J

JP

I have a combo box that is populated by using the ListFillRange property.
When selecting the combo box item ("product"), the price is displayed in the
next column.
Pretty straightforward. But, there are several products with the same
price. If I select a product with the same price as another product, save
the workbook, and the close it, the next time I open the workbook the text in
the combo box changes to the first product with the same price. How do I
keep this from happening?

Thanks
 
N

Net_prof

If these items do not change, populate the Combobox with the
Workbook_Activate event and reference the cell containing the price with the
..additem property instead of using the ListFillRange property. This way you
can control the order the products show up in the combobox.

net_prof
 
J

JP

the items really don't change but the order is not what is giving me the
trouble. I'll save the product name in the combo box but when opening the
workbook at a later time, i'll see the product i selected for a brief second
and then it switches to the product name which has the same price as the one
I selected in the first place.
 
N

Net_prof

Have you defined the .ControlSource property for the combobox? I believe if
you only define the ListFillRange and do not define the ControlSource, your
list value will get reset every time you reinitialize the control (i.e.
reopen the form or workbook/sheet).

But I like to have better control, so I avoid using ListFillRange and just
use the .AddItem or .List() to populate either Combobox or Listbox controls,
then define the ControlSource property where I want to save for next time if
I want to retrieve a previously selected value from the list.

(e-mail address removed)
 
J

JP

I have not set the controlsource. I don't see that as an item in the
properties window though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top