To show the Total of field values across, add a Textbox in the Detail Section and write the expression: = [2011 DIRECT$] + [2011 GPOS$] + [2011 SCT$]
You can display all records total by doing the following trick:
- Create a Textbox in the Form Footer or Form Header area.
- Write the expression =Sum([2011 DIRECT$]) in the Control Source property. You may add Textboxes for other fields also.
- Change the Name Property value of the Textbox to TOTDIRECT
- Display the Property Sheet of the Form.
- Find and select the On Click Event property and select [EventProcedure] from the drop drown list.
- Click on the Build (...) button to open the Module with the empty Form_Click() Event Procedure.
- Write the following Code (or Copy and Paste) within the Event Procedure:
Code:
Dim strDisplay as string
Me.Refresh
strDisplay = "DIRECT Total: " & Format([TOTDIRECT],"0.00")
strDisplay = strDisplay & " GPOS Total: " & Format([TOTGPOS],"0.00")
strDisplay = strDisplay & " SCT Total: " & Format([TOTSCT],"0.00")
Me.Caption = strDisplay
- Save the Form with the code.
- Open the Form in Datasheet View.
- Click at the left border of any record, the Total values of all the three fields will be display on the Caption area (normaly where the Form name is shown) of the Form, replacing the form name.
- Make some change in the [2011 Direct$] field of any record and click on the border of the Form to show the change of total in the form Caption area.
If you want to learn more tricks with Datasheet, check the following Link:
Event Trapping Summary on Datasheet