ms access - Only show data from chosen option from previous column in a lookup field -
i have 3 tables - simplicity let's call them - meat, dish, , order. in meat table, there different types of meat; in dish table, there different types of dishes can prepare types of meats; in orders table, orders these dishes shown. orders table has orderid, meatid, dishid.
i'm trying make in design view on microsoft access when drop menu displays types of meat in meatid column , chooses one, other drop down menu in dishid column display types of dishes in relation meat
if so, there way make access automatically know using code:
select meat.meatname, dish.dishname dish inner join meat on meat.meatid = dish.meatid meatid = [the selected meat in previous column]
you can use meat combobox value criterium, this:
where meatid = forms!yourformname!cbomeat
additionally, in afterupdate event of cbomeat need:
me.cbodish.requery
so read dishes newly selected meat.
for more examples, search for: access linked combo boxes
it's common (and useful) technique.
Comments
Post a Comment