Set RS2 = CurrentDb.OpenRecordset("SELECT * FROM tblWireRoom WHERE [ReelID] = " & vReelID & "")
With RS2
'make sure we are working on the correct reel
If ![ReelID] = vReelID Then ...
Is it normal not to trust your own filter? Why should it work on the second try if it fails on the first?
After filtering, you should rather test if the recordset is empty, which can potentially always occur.
And why are all table fields loaded via * when only one field (CurrentLength) is edited?
General: I do not overlook the meaning of all the code. But my first effort would be mostly to use action queries over everything instead of recordset loops with single entries, i.e. one query per table to be edited.
With RS2
'make sure we are working on the correct reel
If ![ReelID] = vReelID Then ...
Is it normal not to trust your own filter? Why should it work on the second try if it fails on the first?
After filtering, you should rather test if the recordset is empty, which can potentially always occur.
And why are all table fields loaded via * when only one field (CurrentLength) is edited?
General: I do not overlook the meaning of all the code. But my first effort would be mostly to use action queries over everything instead of recordset loops with single entries, i.e. one query per table to be edited.
Last edited: