Count a running total on a unbound field in a report

  • Thread starter Thread starter azaous
  • Start date Start date
A

azaous

Guest
I am running a report with combo boxes giving different information. I am using (below as my code) My problem is I want to total this field from the information in my report I tried dcount but it counts everything in that field from the table not the report can someone help me I have 2 days to get this done the presure is on :-(


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Running total for Worktype Repair
If (Me.WorkType = "Repair") Then
Me.RunningTotal = 1
Else
Me.RunningTotal = 0
End If
 
In the report footer (or section footer if that is where you want the total) add a text box in the text box type:

=sum([RunningTotal])

This assumes that the field name on the report is "RunningTotal" and that it is an integer datatype.

Good luck

GumbyD
 
=Sum(Iif([WorkType] = "Repair",1,0))
 
Thanks guys

I tried the first one before it did not work but the second one did thanks alot for all you help :-) I really appreciate it woo woo
 

Users who are viewing this thread

Back
Top Bottom