Good evening all.
I'm a big Access noob and I'm putting together a little Database to plan transport runs. I've been pondering this for a while now, and I still can't decide the best way to handle the information. Essentially any customer can place numerous orders, and each delivery vehicle will carry numerous orders on its delivery run, but obviously each order can only be delivered on one van to one customer. My tables and relationships are currently these:
Currently the user selects a delivery date when the Order Record is created. A Transport Planner then filters the Order Table by Delivery Date and assigns Delivery Vehicles and Drop Numbers to individual Orders to "create" each delivery run. This is all done via a Form so the user is kept away from datasheet views, etc.
The scope of the database isn't huge - we deliver no more than 7 or 8 orders per delivery van, and we only have 5 vans.
My head is telling me that I should have a Delivery Run Table which would contain:
Delivery Run No (PK)
Delivery Date
Job Number -> From the Order Table
Registration -> From the Vehicle Table
Driver Id -> From an as-yet-uncreated Drivers Table
amongst other things, to better manage individual delivery runs. It strikes me as being both logically and theoretically best practice to store the information in this way, but I can't think of the best way to implement it.
The original user must specify a delivery date upon creation of the order, as this delivery date drives all processes before it, including manufacture. I can't picture a way that this can still happen but the table above could be created/implemented. I think I could programmatically create the delivery runs if the Delivery Date stays in the Order Table (by the user filtering by Date, assigning vehicles and then clicking a "Create Runs" button that creates the new Delivery Run records by looping through each job on the specified date, and grouping them by Delivery Vehicle). However this takes the Delivery Date variable away from the Delivery Run Table, which doesn't seem right to me.
Any advice would be appreciated!