I have an MS Access database which tracks invoices. In the form I use to enter the data, I have the control [Amount] for the invoice amount (e.g. $100). In that form there is also a subform which tracks parts of the invoice (e.g. food supplies for $50 and cleaning supplies for $50). The main form also has the control [Breakdown Total] which sums up the breakdown amounts in the subform.
I am trying to make it so that, unless [Amount] = [Breakdown Total], you can't change records within the form. Because of the two-table structure, it seems that a data validation rule isn't working quite the way I want because it really only works when you fill in the [Amount] control and not if you then change the breakdown.
I thought of building an event to handle this, but I don't know what event to use--BeforeUpdate doesn't let me leave the control which doesn't match, which isn't helpful--what if that's the correct one?--and AfterUpdate doesn't seem to let me require that the suspicious record remain on the screen. Could someone please recommend the event I should be using?
