paccopeland
10-24-2010, 02:36 PM
Please help! I want to click on a button that executes code that will loop through each of the items in an order. The order is split into the order header and the order details - the order details are shown within the order form in a subform. The subform contains all the order items ordered. I want to be able run code from within the order form to carry out an action for all the items in the subform.
I hoped that using the For Each Loop would be the way forward and that it would be quite straight forward. But I'm struggling to work out defining the Object and the Collection. I guess the Collection is the list of relevant order items and the Object is the specific order item - but I'm struggling to convert this to VBA.
Is the For Each Loop the most appropriate way to solve this? Can you help me with the code?
Thanks
Paul
I hoped that using the For Each Loop would be the way forward and that it would be quite straight forward. But I'm struggling to work out defining the Object and the Collection. I guess the Collection is the list of relevant order items and the Object is the specific order item - but I'm struggling to convert this to VBA.
Is the For Each Loop the most appropriate way to solve this? Can you help me with the code?
Thanks
Paul