I am trying to create a report which totals orders. Each record is considered an 'order' unless the flag (MultipleOrders) is turned on, meaning that we needed additional records to include all the parts inside the single order.
In the report I have created the following code (variable rptOrderCount defined earlier in code):
Also, I set rptSameOrder to False initially because I do want to count the order at least once
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
rptOrderCount = rptOrderCount + 1
If Me.MultipleOrder = -1 Then
If RptSameOrder = True Then rptOrderCount = rptOrderCount - 1
RptSameOrder = True
End If
End Sub
This code works if I set the detail section of the report to visible. However, I do not want the detail information to show. If I move the code to the format section I get double the counts and I'm not sure why.
I can provide additional code if necessary. I'm relatively new writing VBA code for access