I am creating a sales/ordering system in VB.NET and MS Access. I have a database consisting of 4 tables: tblOrders, tblOrderDetails, tblProducts and tblManufacturers. I may add more tables if/when I see necessary. These tables are copied from the Northwind sample database.
I assume the purpose of having the order details table is so that one order can have multiple products. If this is the case, when creating an order, what table needs to be written to first? I'm confused about how to write to both tblOrders and tblOrders details when confirming an order.
What I have tried:
I'm not sure what to do. There is a one to many relationship between the OrderID in tblOrders and tblOrderDetails. I'm thinking of writing to the order details table first as this would create a record in the order details table. Because the primary key in the Orders table cannot be left blank, am I correct in thinking it would automatically fill this in for me in the order details table?