View Full Version : Supermarket database... Unsure about relationships


buddythebest
03-31-2006, 03:04 AM
Is this relationship correct (see attachment)? When i create an orders query with the fields:-
Barcode number (source: orders/products table)
Product name (source: products table)
Quantity (source: orders/products table)
Unit price (source: products table)
Total (calculated - [Unit price]*[Quantity] )

it does not allow data entry for barcode number and quantity (product name and unit price should appear automatically when barcode no. entered) why is that? and how could i resolve this?

attached also is my database to see what i mean... if u have time can u please make the modifications NEEDED and send me the modified one, if not just give me a textual description of what i should do..... (btw it is actually a school canteen system databse, thats why i have customerID field as student administration number or staff initials)

please reply soon.. this is urgent

thank you

neileg
04-04-2006, 01:20 AM
Because you have Referential Integrity enforced, you need a record in the Orders table before you can create the corresponding record in the Orders/Products table. If you handle this in a form/subform setup, you can create the order record in the main form, and the order details in a subform.

By the way, don't use punctuation in your object names, viz: Order/Products. It looks as if you are planning to store stock quantities in the table. Bad idea. This has been covered many times in these forums. Search for stock or inventory.