473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to Populate A Combo Box using data from a table

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
3 1857
MMcCarthy
14,534 Expert Mod 8TB
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
etep
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
14,534 Expert Mod 8TB
Thank you!!
No problem.

You're welcome.

Mary
Dec 7 '06 #4

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

Similar topics

1
by: Cindi | last post by:
Hi, Another newbie with a question that I hope someone can point me in the right direction. The goal is to populate a text box with data according to the selection in a combo box while still...
4
by: bill.brennum | last post by:
Hi, This is probably a question with a simple answer, but here goes. I have a form linked to a table. There is a field on that table that while not showing on the form, I would like to...
4
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be...
2
by: Dave McKie | last post by:
Hi all I am trying to Populate a combo box from a selection in an adjacent Listview. The Listview lists as a string the field names of 4 different fields in tblFile. So far I can populate the...
16
by: agrawal.solutions | last post by:
Hello Friends I am asking a very silly question but i dont find any solution fo this.. I am selectiong a recordset and want to populate a combobox where id would be inviseble and the content...
3
by: David | last post by:
I am trying to use Dlookup to populate a text box on a form, but haven't had any good luck so far. I've looked here at the posts and have used the Access help for examples. Northwind is way over...
5
by: KCProg | last post by:
I created a form with a subform. I can populate the subform by moving from record to record in the main form but this is time consuming. I created a combo box on the main form which is populated...
5
FOE2272
by: FOE2272 | last post by:
I have tried every option that I can think of and most of them on this forum. The closest that I got was to bring up the field but it changed the other records based on what was chosen in one...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.