I have a table with seven (7) fields, A1, A2, ATOT, B1, B2, BTOT, TOTAL (all are data type Number). I have a form with controls (Text Boxes) for each field. I have set the form up so that when I enter data in A1 and/or A2, ATOT automatically gets updated. I did this, for A1, and similarily for A2, through the control's properties Event/After Update with the following Event Procedure:
Private Sub A1_AfterUpdate()
Me!ATOT = Me!A1 + Me!A2
End Sub
The controls for B1 and B2 are set up in the same way to update BTOT.
This works fine. I can enter data in A1, A2, B1, or B2, and ATOT and BTOT will update accordingly.
I want TOTAL to be the total of ATOT and BTOT. However, I have not been able to do this. I have tried the 'AfterUpdate' event and also the 'OnChange' event in the controls for ATOT and BTOT and I can't get TOTAL to update.
How can I get TOTAL to automatically update with the total of ATOT and BTOT?
Private Sub A1_AfterUpdate()
Me!ATOT = Me!A1 + Me!A2
End Sub
The controls for B1 and B2 are set up in the same way to update BTOT.
This works fine. I can enter data in A1, A2, B1, or B2, and ATOT and BTOT will update accordingly.
I want TOTAL to be the total of ATOT and BTOT. However, I have not been able to do this. I have tried the 'AfterUpdate' event and also the 'OnChange' event in the controls for ATOT and BTOT and I can't get TOTAL to update.
How can I get TOTAL to automatically update with the total of ATOT and BTOT?