This may be a convoluted way of doing it, but this is what I'm trying to do:
Background:
We're getting two CSV files from a shopping cart, order.csv and
orderitem.csv, which are imported into an Access db and processed.
Order.csv contains the orderID, payer info, number of items and total of
order. Orderitem.csv contains the orderID associated with that item, price
and item info. There may be one or more items associated with one orderID,
however there is no individual item# provided by the cart.
Goal:
-- To assign an item # to each item so that the orderID and the item#
together will create a unique ID and have meaning to a person looking at it.
Basic Logic:
Set ALL TempCartOrderID to 1 (initialize, Update Query for all records in
the table)
Set ALL TempItemNumber to 1 (initialize, Update Query for all records in
the table)
Loop – DO UNTIL EOF.
If TempCartOrderID <> CartOrderID,
Set TempItemNumber to 1 (update query)
CreateID# (update query)???
Set ALL TempCartOrderIDS to this CartOrderID (in this record)(Update
Query)
Go to Next Record
If TempCartOrderID = CartOrderID (item #2 or greater on a multiple
item order)
TempItemNumber = TempItemNumber + 1
CreateID# (update query)???
Set TempCartOrderID to CartOrderID
(Logic for resetting the TempItemNumber back to one or leaving it
incremented if there is another duplicate CartOrderID)??
Go to Next Record
I'm not real clear on parts of it. The way I'd set up the macro would be
similar to Article 90814:
Macro Name Action
-------------------------
Do_Loop1 RunMacro
Loop1 MsgBox
Do_Loop1 Actions
--------------------------------------
RunMacro
Macro Name: Do_Loops.Loop1
Repeat Expression: <your_condition>
Loop1 Actions
-------------------
MsgBox Message: ="Loop"
Not quite sure how to set up the Repeat Expression to go to the EOF, or if
there is a better, simpler way to do the whole thing. Any help you can give
would be appreciated. Thanks, Ken.
Richard