How to loop through controls with VBA
Posted on 2004-11-03
I have a form with the following text boxes:
txtOrderNo1 txtItemNo1 txtTrxQty1 txtComment1
txtOrderNo2 txtItemNo2 txtTrxQty2 txtComment2
txtOrderNo3 txtItemNo3 txtTrxQty3 txtComment3
txtOrderNo10 txtItemNo10 txtTrxQty10 txtComment10
I need to loop through these controls and process each line (OrderNo, ItemNo, TrxQty, & Comment). However, this is with VBA so I cannot setup an array of controls and there is no Index property. I would like some method of looping through these controls without copying/pasting my code 10 times.
Let me know if you need any more information. Thanks.