我有三张桌子:
1) Manufacturer
2) Model
3) Vehicle
制造商表格摘录:
Manufacturer
BMW
Merc
Toyota
模型表提取:
Manufacturer Model
BMW 330
BMW 325
BMW 340
Merc A200
Merc C350
Toyota Land Cruiser
Toyota Tundra
车辆表
VehicleNo Manufacturer Model
1 Toyota Only Tundra or Land Cruiser
2
3
4
5
解决方案在MS Access中,因此没有表单。以下选项直接在车辆表上进行。用户从Manufacturer表中选择Manufacturer,从Vehicle表中的model表中选择模型。问题是我想将模型的可能选择限制为已为该订单项选择的制造商。也就是说,如果丰田被选为制造商,则只能选择陆地巡洋舰和苔原作为模型。
查询当前返回所有模型,作为每辆车选择的制造商的可能选择。目前的例子:如果BMW和Merc被选为车载制造商,那么所有BMW和Merc车型都可以在Model领域中选择。
当前查询:
SELECT Model.[Model]
FROM Manufacturer
INNER JOIN (Model INNER JOIN VEHICLE ON (Model.[Model] = VEHICLE.Model)
AND (Model.Manufacturer = VEHICLE.Manufacturer))
ON (Manufacturer.Manufacturer = Model.Manufacturer)
AND (Manufacturer.Manufacturer = VEHICLE.Manufacturer)
WHERE (((VEHICLE.Model)=[Model].[Model]))
ORDER BY VEHICLE.Model;