PC Review


Reply
Thread Tools Rate Thread

Combo Box Changes When Opening Workbook

 
 
JP
Guest
Posts: n/a
 
      7th Apr 2008
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

 
Reply With Quote
 
 
 
 
Net_prof
Guest
Posts: n/a
 
      7th Apr 2008
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



"JP" wrote:

> 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
>

 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      8th Apr 2008
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.

"Net_prof" wrote:

> 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
>
>
>
> "JP" wrote:
>
> > 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
> >

 
Reply With Quote
 
Net_prof
Guest
Posts: n/a
 
      8th Apr 2008
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 Removed)


"JP" wrote:

> 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.
>
> "Net_prof" wrote:
>
> > 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
> >
> >
> >
> > "JP" wrote:
> >
> > > 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
> > >

 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      8th Apr 2008
I have not set the controlsource. I don't see that as an item in the
properties window though.

"Net_prof" wrote:

> 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 Removed)
>
>
> "JP" wrote:
>
> > 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.
> >
> > "Net_prof" wrote:
> >
> > > 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
> > >
> > >
> > >
> > > "JP" wrote:
> > >
> > > > 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
> > > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
combo box - opening a workbook =?Utf-8?B?YW5kcmV3?= Microsoft Excel Misc 0 22nd May 2007 10:34 AM
Combo box list w/ data in 2nd workbook without opening both files =?Utf-8?B?TUhDUE8=?= Microsoft Excel Worksheet Functions 0 15th Dec 2005 07:15 PM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Microsoft Excel Programming 1 16th Dec 2003 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555 Microsoft Excel Programming 2 15th Dec 2003 11:07 PM
Suppress blank workbook when opening Excel workbook from Windows Explorer Keeeron Microsoft Excel Misc 1 8th Nov 2003 03:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:43 PM.