Hi
I think this should be straight forward, but I'm new to VBA in Access and can't figure it out
Here's what I'm trying to do:
I'm trying to create an order of several products from a supplier with different costs associated with each product. This bit is fine, I can work out how many of each product I need. However, each supplier has a minimum cost of order for them to deliver. I therefore need to take the order that I definately need, and if it's less than the minimum cost to deliver, I need to keep adding cases of products that will run out soon until the minimum cost is achieved.
I've attached a word doc showing example tables.
From these, the "cold drinks" supplier has a minimum order cost of £10, but the current order only comes to £8.50. I need the code to look at the "Current Order" table, see that "Water" will run out first (minimum of "Days to Zero Stock" column for "Cold Drinks"), add the cost of an extra water to the delivery cost (£8.50 + £0.30 = £8.80), which is still too little, then move to the next product to run out - "Lemonade" and do the same procedure. Then keep doing it until the £10.00 has been reached, then fire out final order quantities to another table (or update the original).
Any help / suggestions / example code would be great!
Thanks in advance
I think this should be straight forward, but I'm new to VBA in Access and can't figure it out
I'm trying to create an order of several products from a supplier with different costs associated with each product. This bit is fine, I can work out how many of each product I need. However, each supplier has a minimum cost of order for them to deliver. I therefore need to take the order that I definately need, and if it's less than the minimum cost to deliver, I need to keep adding cases of products that will run out soon until the minimum cost is achieved.
I've attached a word doc showing example tables.
From these, the "cold drinks" supplier has a minimum order cost of £10, but the current order only comes to £8.50. I need the code to look at the "Current Order" table, see that "Water" will run out first (minimum of "Days to Zero Stock" column for "Cold Drinks"), add the cost of an extra water to the delivery cost (£8.50 + £0.30 = £8.80), which is still too little, then move to the next product to run out - "Lemonade" and do the same procedure. Then keep doing it until the £10.00 has been reached, then fire out final order quantities to another table (or update the original).
Any help / suggestions / example code would be great!
Thanks in advance