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

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

mysql - FireDac error 314 - but DLLs are in program directory -