简体   繁体   中英

How to populate combo box with values in MS Access 2007

I have a database with 3 tables.

Manufact: ID, Name, Decription

Model: ID, Manufact_ID, Name

Order: ID, Manufact_ID, Model_ID, Quantity, Date,

In Access I would like to have the normal table/datasheet view for Order which gives the following output

ID Manufact.Name Model_ID(combo box) Quantity Date  
1  LG            W3000H-BN            10       02-01-2009
2  SAMSUNG       SyncMaster 205BW      5       02-20-2009
3  SAMSUNG       SyncMaster 206BW      2       03-18-2009
4  Iiyama        ProLite E1902S-B1     1       05-13-2009

My problem is the combo box. I want to have only the list of the Models of the curent Manufacturer selectable in the combo box. eg: only the SAMSUNG models if SAMSUNG is selected. I tried to set the Lookup row source for Model_ID column as

SELECT Model.ID,Model.Manufact_ID,Model.Name,Order.Manufact_ID \ 
FROM Model, Order WHERE Order.Manufact_ID = Model.Manufact_ID

This is actually an Model INNER JOIN Order ON ... giving the wrong result. How can I refer to the actual value of Order.Manufact_ID in the actual row's Lookup SELECT command? It's a variable value I cannot stringify.

Thanks!

strauss

Unfortunately this isn't possible. A combo box on a form can only have 1 source, it cannot have different sources for each record on a datasheet or multi-record form.

You may wish to read this post, which seems to be the same as yours. It provides a solution:

Is there a simple way of populating dropdown in this Access Database schema?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM