We are converting our Product Order system database to be able to send daily order details to the manfacturer's EDI system but we have a problem incorporating certain product codes into this order.
Background:-
We sell products either as a single entity or in a kit that comprises that and other products. Eg, we sell a Car Cleaning Kit that comprises a sponge, manufacuturer's #12345, a wheel cleaning brush, #98765 and a leather, #99889. We give this kit our own product code (MUK80 as an example) which is what the customer orders when he buys.
All those component parts are also sold as single items, using the manufacturer's product codes as quoted above.
We reorder stock daily based on a query that extracts the product codes and quantities from the daily sales invoices. Amongst these codes are of course the "MUK.." kits, but as the manufacturer doesn't recognise these codes we can't include these on the EDI order.
We have the details of these kits contained in a table; col 1 is the kit product code (eg MUK80) and the other columns separately contain the consist part codes and quantity of each consist. To use the example above, MUK80 has #12345 qty 1, #98765 qty 1, #99889 qty 1.
A kit can have anything up to 6 consists. So the table consists of 13 Cols - the Kit product code and 6 columns for consist product codes and quantities. At this time we have 130 different kits and increasing.
What I need to do is to be able to extract the consist #'s and qty of the kits sold and add these to the order list. This list may already have some of the parts on there as they could also have been sold as a single item.
To give an example of this, let's say we sell 3 of the MUK80 Car cleaning kits; At the moment the MUK80 qty 3 will appear on the reorder query, but what I need is to get the consist parts of that kit added to the list instead.
So as a final example, let's say we also sold 2 sponges #12345 and one brush #98765 as products in their own right; the EDI order for that day should therefore have #12345 total qty 5 and # 98765 total qty 4.
The trick I'm missing is how to get those consist parts onto the final reorder output which is a csv file containing only 2 columns, Prodcut Code and Total Quantity.
We have a macro that exports this order as a csv file that we then convert to xml outside of access.
I would really appreciate any help on this - a query would be my preferred option ( I'm none too bright using VBA) but I'm up for the challenge should it be necessary.
Sorry for the longwinded post, but I thought a detailed explanation may help frame the problem.
Thanks in anticipation....
Mike