Bigsteve42
Technical User
Have tried everything but can't seem to get this to work
I have a subform with two fields = debits and credits there is two calcualted controls on the subform footer totaling debits and credits (called TotalCredits and TotalDebits. On the main form is a save button. Since the debits and credits must balance the save button should not be enabled until the two footer controls are equal. I have written the following code:
If Me![TotalDebits] = Me![TotalCredits] Then
Forms!FrmNtmain!Save.Enabled = True
Else: Forms!FrmNtmain!Save.Enabled = False
Endif
When I try this in the AfterUpdate or Exit event it only works after these events have taken place on the next line of the subform. I think the problem is that by the time the total controls are updated the AfterUpdate or Exit events of the Debit and Credit controls have already passed. Could anyone please offer a suggestion? Is it possible to do a loop that would work?
Thanks
I have a subform with two fields = debits and credits there is two calcualted controls on the subform footer totaling debits and credits (called TotalCredits and TotalDebits. On the main form is a save button. Since the debits and credits must balance the save button should not be enabled until the two footer controls are equal. I have written the following code:
If Me![TotalDebits] = Me![TotalCredits] Then
Forms!FrmNtmain!Save.Enabled = True
Else: Forms!FrmNtmain!Save.Enabled = False
Endif
When I try this in the AfterUpdate or Exit event it only works after these events have taken place on the next line of the subform. I think the problem is that by the time the total controls are updated the AfterUpdate or Exit events of the Debit and Credit controls have already passed. Could anyone please offer a suggestion? Is it possible to do a loop that would work?
Thanks