A little too tricky for me...

sroughley

New member
Local time
Today, 04:49
Joined
Jan 22, 2003
Messages
5
Hello all. I am new to this forum (and am thankful that I have come accross it. Pheeeww!) and find that this problem could cover many aspects of Access, so I felt that this would be the best forum to ask. Also, I should point out that I don't usually use Access for DB design (I usually use PHP/MySQL), so excuse me if the solution to this problem is obvious.

Ok, I have a system in development that is for the ordering and delivery of solid fuels and the maintaining of customer and driver/vehicle records. Please see the ERD I have here..

The system works by allowing a user to create orders and to specify deliveries. When there are enough orders, deliveries are scheduled/created and orders are added to the delivery by creating a delivery item(s) for each delivery.

Now the problem is that I need to find a way of making sure that deliveries are comprised only of orders belonging to customers in a single area. For example, customer A lives in region R1, but delivery 345 is going to R2, while delivery 347 is going to R1. so I would like some way of making sure that customer A's order does not go on delivery 345, but that it goes on delivery 347.


Now this is a little too tricky for a first-time Access user (I imagine it could involve VB or Form Queries, which I could do in PHP quite easily, but I am in deep water here), so I would really appreciate your help. If I have not made any particular points very clear then please let me know.

Thank you for your time.

Steve.
 
Last edited:
The system works by allowing a user to create orders and to specify deliveries. When there are enough orders, deliveries are scheduled/created and orders are added to the delivery by creating a delivery item(s) for each delivery.

How do you know when there are enough orders? Who schedules the deliveries? You can make sure the right orders are added to the right deliveries using something like this...

Note: I am replacing all spaces in names for convenience of writing the SQL.

INSERT INTO DELIVERY_ITEM (SELECT DELIVERY_NO, ORDER_NO FROM DELIVERY, ORDER WHERE ORDER.REGION_CODE = DELIVERY.REGION_CODE AND ORDER.DISPATCHED='FALSE';
 

Users who are viewing this thread

Back
Top Bottom