Combo box help please

  • Thread starter Thread starter Charlie
  • Start date Start date
C

Charlie

I have a combo box with 4 fields which is using a query made from 2 related
tables. Column 0 populates the primary table and I need column 1 to populate
the secondary table once selected in the form. The details from each field
are located on the form (hidden with a visible field which joins columns 2&3
into one field)

Is there a way to do this? Really do not want to split this down if I can
help it. If I do need to split it, is there a way to select column 0 and it
make the 2nd combo box only show related entries e.g

Current Combo - 0=Company Name, 1=ContactID, 2=FirstName, 3=LastName

If Split:-
Combo 1 - 0=Company Name
Combo 2 - Only show contacts linked to Company Name

Many thanks in advance.

Charlotte
 
Hi Allen,

Thank you for your response - attempting the SQL option however, I could
just be having a dumb moment but I do not quite understand the following:

Let's say you have two comboboxes, cbxCombo1 and cbxCombo2. The
RowSourceType of cbxCombo1 is set to "Field List" and RowSource to a table
Category. cbxCombo2 doesn't have anything under RowSource.

I can do all of this but do not know what you mean by RowSource to a "table
Category"

Charlotte
 
Good pickup, Bruce. The page is inconsistent.

(It's actually not my page, so I'll see if I can get Arvin to fix it, as I
believe he's looking after Dev's pages.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


BruceM via AccessMonster.com said:
In Allen's example Category is the name of a table, from what I can tell.
I
am a bit confused, though, as the code uses the table named Categories.
Unless I have completely missed something, I think the intent is that it
be
the same table name in the explanation before the code and in the code
itself.


In any case, Allen's sample code calls for selecting the field name from
the
first combo box, which would limit what is displayed in the second combo
box.
That is one way to do it, but he also describes another way below the code
example.

I am unclear what you mean by "Column 0 populates the primary table and I
need column 1 to populate the secondary table once selected in the form".
What are the primary and secondary tables? How are they related, and how
do
they fit into your design?
Hi Allen,

Thank you for your response - attempting the SQL option however, I could
just be having a dumb moment but I do not quite understand the following:

Let's say you have two comboboxes, cbxCombo1 and cbxCombo2. The
RowSourceType of cbxCombo1 is set to "Field List" and RowSource to a table
Category. cbxCombo2 doesn't have anything under RowSource.

I can do all of this but do not know what you mean by RowSource to a
"table
Category"

Charlotte
See:
Limit content of combo/list boxes
[quoted text clipped - 27 lines]
 
Hi Bruce,

My primary tables has Companies and my secondary holds Contacts for those
companies, these are linked by a 1 to many relationship. I also have a third
table which holds the order details which are again linked with a 1 to many
relationship to the contact. My problem is that when i am entering an order
I want to select the company followed by the relevant contact and in doing
so, populating the relevant fields in the order table.

I am pretty naff when it comes to sql or VBA so was looking for an alternate
option.

Charlotte

BruceM via AccessMonster.com said:
In Allen's example Category is the name of a table, from what I can tell. I
am a bit confused, though, as the code uses the table named Categories.
Unless I have completely missed something, I think the intent is that it be
the same table name in the explanation before the code and in the code itself.


In any case, Allen's sample code calls for selecting the field name from the
first combo box, which would limit what is displayed in the second combo box.
That is one way to do it, but he also describes another way below the code
example.

I am unclear what you mean by "Column 0 populates the primary table and I
need column 1 to populate the secondary table once selected in the form".
What are the primary and secondary tables? How are they related, and how do
they fit into your design?
Hi Allen,

Thank you for your response - attempting the SQL option however, I could
just be having a dumb moment but I do not quite understand the following:

Let's say you have two comboboxes, cbxCombo1 and cbxCombo2. The
RowSourceType of cbxCombo1 is set to "Field List" and RowSource to a table
Category. cbxCombo2 doesn't have anything under RowSource.

I can do all of this but do not know what you mean by RowSource to a "table
Category"

Charlotte
See:
Limit content of combo/list boxes
[quoted text clipped - 27 lines]

--
Message posted via AccessMonster.com


.
 
Okay: Arvin has now corrected the page, to make it consistent.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Allen Browne said:
Good pickup, Bruce. The page is inconsistent.

(It's actually not my page, so I'll see if I can get Arvin to fix it, as I
believe he's looking after Dev's pages.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


BruceM via AccessMonster.com said:
In Allen's example Category is the name of a table, from what I can tell.
I
am a bit confused, though, as the code uses the table named Categories.
Unless I have completely missed something, I think the intent is that it
be
the same table name in the explanation before the code and in the code
itself.


In any case, Allen's sample code calls for selecting the field name from
the
first combo box, which would limit what is displayed in the second combo
box.
That is one way to do it, but he also describes another way below the
code
example.

I am unclear what you mean by "Column 0 populates the primary table and I
need column 1 to populate the secondary table once selected in the form".
What are the primary and secondary tables? How are they related, and how
do
they fit into your design?
Hi Allen,

Thank you for your response - attempting the SQL option however, I could
just be having a dumb moment but I do not quite understand the following:

Let's say you have two comboboxes, cbxCombo1 and cbxCombo2. The
RowSourceType of cbxCombo1 is set to "Field List" and RowSource to a
table
Category. cbxCombo2 doesn't have anything under RowSource.

I can do all of this but do not know what you mean by RowSource to a
"table
Category"

Charlotte

See:
Limit content of combo/list boxes
[quoted text clipped - 27 lines]

.
 
Back
Top