spacepro said:
Q1: How difficult would it be to assign all of the loads at once, am I looking at your previous suggestion of a field in the table for old/new record, just wondering how i would progress through the records to assign the loads.
Not too difficult (
if you understand how the code works), just time comsuming for me to add right now.
Here what I had thought to add but didn’t have the time to. Here was my plan of attack, feel free to try to add this yourself;
- Add a field to the tblOrders, let's call it New (
Yes/No field) and set the default value to Yes. This way every new order entered via the database is a "New" order.
- Then create a query that selects all the "New" orders, call it qryOrdersNEW.
- Then you just have to loop through the existing code for each value of OrderID in this new query.
- The queries that select the Big/Small items order details will have to become parameter queries with the parameters set from code to select on OrderID
- After assigning truck space for an individual OrderID, set the value of “New” to No
spacepro said:
Q2: What I am thinking is that we are currently taking on a new business contract where the vehicles are different sizes.
This can be accomplished if you change the code. Instead of using the number 21 in the code. Change the number 21 in the code (
where appropriate – should be everywhere 21 occurs) to a variable (
e.g. TruckSize). And then the size of the truck could then be a field in tblClient since it sounds like each client has their own size of trucks. Use the same query that pulls the "New" Orders to also grab the TruckSize.
spacepro said:
The db that you wrote is for our primary contract, one size of vehicle, but the new contract are different sized vehicles, now I looking at the design and integrating another table:
But, what happens if a client has a mix of truck sizes? Not just a mix, but how about having only a certain number of each size available? As you can see, the more variables and limitations you add, the more tables, queries, lines of code need to be added to handle all the possibilities.
Lotsa of possibilities;
- What is clients share trucks?
- What if certain trucks can only go certain places and not others?
- What is a truck has the space but can only carry up to a certain weight? 21 of
Fridge A might be OK, but 21 of
Fridge B might not?
Incidentally, I had wondered if it was possible to have a table to store individual trucks, each with their own
- size
- marked as available or not available
- also somehow used to not schedule the truck more than once in a day.
Unless it could carry two orders (
or parts of them) for two different locations that were in the same directions (
Very ambitious but since it was jsut a mental excercise)
That may or may not work here. Obviously, I ddin't add that as I did not know if that was a possibility based on all the previous posts.