I am trying to add a field from the purorddet table to the Sales Order Entry screen (40.100.00). The field is used to store a tracking number for Sales Orders that generate a Purchase Order. I have added the Purorddet table to the screen using a VBASetAddr call, and have declared a cursor on the PurOrdDet table using SQLCursorEx. I have written a stored procedure that returns the Purorddet record when supplied with a Sales Order number and Lineref value. Finally, I have added the field from purorddet to the Sales Order Entry screen, in the grid.
When I put code in the check event for the Order Number, the code fires and the Tracking number populates on the first line item for the order. However, all subsequent lines show the same tracking number as the first line.
I know I likely have to loop through the lines in the grid and execute the stored procedure for each line, but I am not sure how to do that in VBA. Any help would be very much appreciated.
John
*This post is locked for comments