February 2, 200520 yr Is any-one able to help me i am currently making a database for a restraunt and I am trying to get a price to display when I select a type of drink followed by a size both these values should correspond to give the price any help on this matter would be greatly appreciated
February 2, 200520 yr There are a few ways to do this, but this is probably the simplest. Make a compound key field based on the type and size. So, assuming that your fields are called "DrinkType" and "Size," you could make a calculated key field "TypeSize" with the formula: DrinkType & Size Then use TypeSize as the key field to your price table relationship. Then in your related price table, you need to have a record for every drink type and size combination with a corresponding key field TypeSize. Like so: TypeSize Price -------------- BeerSmall $2.50 BeerMedium $3.00 BeerLarge $4.00 ScotchSmall $3.00 ScotchLarge $4.00 MartiniSmall $3.50 MartiniLarge $4.50 etc.
Create an account or sign in to comment