By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

How to Populate A Combo Box using data from a table

P: 3
I have been trying to figure this out for about 2.5 hours now. These discussions must contain the concise answer somewhere, but I can't find it. I think there is a way to do this without resorting to VB, but I'm not sure. And now...

I want to create an order management database. I have the following tables:
Orders
Products

The products table lists details about products, for example
1 ProductA VersionA1
2 ProductA VersionA2
3 ProductB VersionB1
4 ProductB VersionB2

I have an order form. One combo box selects the product. I need a combo box that lists only the applicable versions based on the selected product.

This should be easy right? Please help!

Thank you,
Pete Stevenson
Dec 7 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Set the Row Source of the second combobox to:

Expand|Select|Wrap|Line Numbers
  1. SELECT VersionField FROM Products WHERE ProductField=[Forms]![FormName]![FirstComboboxName]
  2.  
In the After Update event of the first combo box put the following line of code.

Expand|Select|Wrap|Line Numbers
  1. Me.SecondComboboxName.Requery
Mary
Dec 7 '06 #2

P: 3
Thank you!!

Set the Row Source of the second combobox to:

Expand|Select|Wrap|Line Numbers
  1. SELECT VersionField FROM Products WHERE ProductField=[Forms]![FormName]![FirstComboboxName]
  2.  
In the After Update event of the first combo box put the following line of code.

Expand|Select|Wrap|Line Numbers
  1. Me.SecondComboboxName.Requery
Mary
Dec 7 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Thank you!!
No problem.

You're welcome.

Mary
Dec 7 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.