I have a continuous form with table Donations. Each donation can be broken down to one or more designated areas which I call ItemizedGifts. So when I click on a Donation record, the Current event causes the subform below to query for the list if ItemizedGifts. The total of the items must balance with the Donation, so I have a text field, Err, which shows a red 'X' when they do not balance, and is cleared when they do.

The check is made by comparing the Donation amount with: TotalItems = DSum("Amount", "ItemizedGifts", "RevBatchID = GetItems4Batch()")

I have followed the code step by step during run to know exactly what the problem is... but not how to fix it.

During entry of the items, the Amount is entered first. The update event of Amount triggers this:
Me.Dirty = False 'causes record to be saved so that the DSum in DoMath will include the immediate record
Form_Donations.DoMath

DoMath has a number of entries, but the offending one is here...
If MyMath <> 0 Then
CurrentDb.Execute "UPDATE Donations SET Error = 'X' WHERE RevBID = " & MyBatch
Else: CurrentDb.Execute "UPDATE Donations SET Error = '' WHERE RevBID = " & MyBatch
End If

Anyway, when the user is enters the record amount that balances MyMath the update query removes the 'X' in the main form record, and when the code ends, and the 'X' shows up, it requeries the subform and sends the focus to the first record. The user then needs to reset focus to finish entering that line. I do not believe any of my code calls for the requery, so it must be internal on updating information on the main form. When removing the Execute query code, the subform works fine. So it is certainly causing the issue.

I could wait until the end of the record entry to update, but would prefer a fix when the amount is entered.

Any ideas?