Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Combo boxes on multi record form


Message #1 by "Steve Sutton" <steve.sutton@s...> on Mon, 24 Feb 2003 11:53:14
I have a form where depending upon the choice made in the first combo box, 
the 2nd combo box list changes. eg Company 1 makes item 1, item 2 item 3. 
Company 2 makes item a, item b, item c. So if you choose Company 1 only 
the 3 items it makes are shown in the second combo box.

Okay, this works fine for the first record displayed, if i go on to add 
further records, when I put the next line in for company 2 the second 
combo box on both records changes to the list of products made by company 
2!

Any thoughts would be most welcome.

Cheers

Steve
Message #2 by "Gregory Serrano" <SerranoG@m...> on Mon, 24 Feb 2003 13:23:40
Steve,

<< Okay, this works fine for the first record displayed, if i go on to add 
further records, when I put the next line in for company 2 the second 
combo box on both records changes to the list of products made by company 
2! >>

Without seeing exactly what's going on, it's hard to diagnose and repair.  
Off the top of my head, make sure that your .RowSource properties for all 
comboboxes are set correctly.  For example, make sure you have the 
proper "After Update" event from combobox1 changing the rowsource of 
combobox 2 depending on combobox1's selected value.  Also, make sure the 
rowsources are reset on the form's "On Current" event.

Greg
Message #3 by "Steve Sutton" <steve.sutton@s...> on Mon, 24 Feb 2003 14:13:34
Greg,

Have checked all this, but still no luck!

I'll try to explain it some more.

form looks a bit like this:-

   Manufacturer           Products

   Man1                   Man1 Prod1

So at this stage the lists both work, I can change the manufacturer and 
the Products correctly change. Now I add a second line

   Man 2                  Man2 Prod2

The screen then changes to display

   Man1                   "blank"
   Man2                   Man2 Prod1

If I change my selection again to have both lines with the same 
manufacturer then the screen displays as you would expect

   Man 1                  Man1 Prod1
   Man 1                  Man1 Prod2

I doubt that this makes it any clearer, but I live in hope!

Steve
Message #4 by "Gregory Serrano" <SerranoG@m...> on Mon, 24 Feb 2003 17:40:42
Steve,

<< I doubt that this makes it any clearer, but I live in hope! >>

I don't understand what you're showing me.  I thought you were having 
problems with comobox rowsources.  What you've shown me looks like a form 
in datasheet view.  You need to draw a better picture of what you have.  
Are "Manufacturer" and "Products" two comboboxes, and are you showing me 
what their dropdown lists look like when you click on them?  Or are you 
showing me data on a form?

Greg
Message #5 by "Steve Sutton" <steve.sutton@s...> on Mon, 24 Feb 2003 23:24:41
> Steve,

> << I doubt that this makes it any clearer, but I live in hope! >>

> I don't understand what you're showing me.  I thought you were having 
p> roblems with comobox rowsources.  What you've shown me looks like a 
form 
i> n datasheet view.  You need to draw a better picture of what you have.  
A> re "Manufacturer" and "Products" two comboboxes, and are you showing me 
w> hat their dropdown lists look like when you click on them?  Or are you 
s> howing me data on a form?

> Greg

Manufacturer and Products are 2 comboboxes the products one is dependent 
on the choice made in Manufacturer. The data is in a continuous form. The 
lines represent different records. The problem arises when the choice in 
the first combobox is different in both records, depending on the record 
in focus the second combo box changes in both records!
Message #6 by "Bill Findlay" <findlay@t...> on Tue, 25 Feb 2003 13:02:03 -0500
I have run into the same problem.

Possible solutions...

1. Make the continuous form a single form with a navigation control for 
scrolling thru the records

2.  Instead of showing the records on a continuous form make it a single 
form and show the records in a listbox.  When you want to add, update or 
delete records -  double-click the listbox and bring up a single form with 
the desired record showing and make shenges there.  When the form closes 
you can then requery the listbox and show the changes.

Bill Findlay

>>> SerranoG@m... 02/24/03 01:23pm >>>
Steve,

<< Okay, this works fine for the first record displayed, if i go on to 
add
further records, when I put the next line in for company 2 the second
combo box on both records changes to the list of products made by 
company
2! >>

Without seeing exactly what's going on, it's hard to diagnose and repair. 

Off the top of my head, make sure that your .RowSource properties for 
all
comboboxes are set correctly.  For example, make sure you have the
proper "After Update" event from combobox1 changing the rowsource of
combobox 2 depending on combobox1's selected value.  Also, make sure 
the
rowsources are reset on the form's "On Current" event.

Greg


Message #7 by "Steve Sutton" <steve.sutton@s...> on Wed, 26 Feb 2003 10:10:40
Okay, thanks for your assistance, I'll explore those alternative solutions.

Cheers

Steve
Message #8 by "Gregory Serrano" <SerranoG@m...> on Wed, 26 Feb 2003 13:32:03
<< Manufacturer and Products are 2 comboboxes the products one is 
dependent on the choice made in Manufacturer. The data is in a continuous 
form. The lines represent different records. The problem arises when the 
choice in the first combobox is different in both records, depending on 
the record in focus the second combo box changes in both records! >>

Oh, OK... the problem probably lies in the fact that you're using 
continuous forms.  Objects on continuous forms have that nasty habit of 
working "all or nothing."  For example, if you change the backcolor of the 
detail section of one form, they all change, not just the one record.  
People have to get around that using conditional formatting.  Your problem 
is similar.

I think Bill's advice is the way to go; although exercise caution.  His 
second suggestion includes double-clicking on a listbox.  This action is 
neither Windows standard or intuitive to users.  Listboxes are for 
choosing items, not for double-clicking on them.  If you do program a 
double-click event on a listbox, make sure you let users know that 
functionality is there.  Otherwise, use the standard "command button near 
the listbox to activate something from the list" approach instead.

Greg
Message #9 by "Bill Findlay" <findlay@t...> on Wed, 26 Feb 2003 11:35:18 -0500
Greg is correct when he says to inform your users that the functionality 
exits by double-clicking the listbox. 

But just by the fact that the double-click event exits for the listbox 
suggests the intention for it's use.  I have used this process without 
incident.  Be aware that if a command button approach is the method of 
choice the user must be instructed to select a line in the listbox before 
clicking the command button.  Remember the selection in the listbox is the 
"key" for the form that will be opened by the command button.

Cheers!!!

Bill Findlay

>>> SerranoG@m... 02/26/03 01:32pm >>>
<< Manufacturer and Products are 2 comboboxes the products one is
dependent on the choice made in Manufacturer. The data is in a continuous

form. The lines represent different records. The problem arises when 
the
choice in the first combobox is different in both records, depending on
the record in focus the second combo box changes in both records! >>

Oh, OK... the problem probably lies in the fact that you're using
continuous forms.  Objects on continuous forms have that nasty habit of
working "all or nothing."  For example, if you change the backcolor of 
the
detail section of one form, they all change, not just the one record. 
People have to get around that using conditional formatting.  Your 
problem
is similar.

I think Bill's advice is the way to go; although exercise caution.  His
second suggestion includes double-clicking on a listbox.  This action 
is
neither Windows standard or intuitive to users.  Listboxes are for
choosing items, not for double-clicking on them.  If you do program a
double-click event on a listbox, make sure you let users know that
functionality is there.  Otherwise, use the standard "command button 
near
the listbox to activate something from the list" approach instead.

Greg



  Return to Index