If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo box help please
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 |
#2
|
|||
|
|||
Combo box help please
See:
Limit content of combo/list boxes at: http://www.mvps.org/access/forms/frm0028.htm -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Charlie" wrote in message ... 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 |
#3
|
|||
|
|||
Combo box help please
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 "Allen Browne" wrote: See: Limit content of combo/list boxes at: http://www.mvps.org/access/forms/frm0028.htm -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Charlie" wrote in message ... 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 . |
#4
|
|||
|
|||
Combo box help please
Hi Charlie,
I think you can find some examples here that can help you: http://www.askdoctoraccess.com/DownloadPage.htm look at the "Demo Cascading Combo Boxes" example. Good luck. Charlie wrote: 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201003/1 |
#5
|
|||
|
|||
Combo box help please
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? Charlie wrote: 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 http://www.accessmonster.com/Uwe/For...forms/201003/1 |
#6
|
|||
|
|||
Combo box help please
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 Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "BruceM via AccessMonster.com" u54429@uwe wrote in message news:a4747a9f345b6@uwe... 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? Charlie wrote: 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 http://www.accessmonster.com/Uwe/For...forms/201003/1 |
#7
|
|||
|
|||
Combo box help please
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" wrote: 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? Charlie wrote: 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 http://www.accessmonster.com/Uwe/For...forms/201003/1 . |
#8
|
|||
|
|||
Combo box help please
If there is more than one contact per company, how can you have ContactID as
part of the Row Source query, unless you are showing: Acme Co. Alan Acme Co. Bruce Acme Co. Cheryl However, this seems clumsy. Seems to me you would select the company using a combo box, then have the contacts each as a separate record in a subform based on the Contacts table. Or maybe you are selcting a company, then you want another combo box on the same form (as part of the same record) for selecting the Contact. Either way, the second part of Allen Browne's link describes in general terms how to limit the second combo box to the contacts for the company selected in the first combo box. I (or somebody else) could provide more details, but it would help to have a clearer understanding of what exactly you are trying to do. Charlie wrote: 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 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. [quoted text clipped - 30 lines] . -- Message posted via http://www.accessmonster.com |
#9
|
|||
|
|||
Combo box help please
Okay: Arvin has now corrected the page, to make it consistent.
-- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Allen Browne" wrote in message ... 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 Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "BruceM via AccessMonster.com" u54429@uwe wrote in message news:a4747a9f345b6@uwe... 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? Charlie wrote: 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 http://www.accessmonster.com/Uwe/For...forms/201003/1 |
Thread Tools | |
Display Modes | |
|
|