beatomatic
Technical User
I am currently trying to run a report based on a SQL query. I have a field called "Wage" that I am summing up, for each employee, which are grouped under a manager. So, in my report I have two groups, the first is Manager, and the Second is Employee, followed by the detail section. I am doing my calculations in the VB code, and it is something like this:
-----------------------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txtManagerTotal = txtWage + txtManagerTotal
txtEmployeeTotal = txtWage + txtEmployeeTotal
End Sub
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
txtManagerTotal = 0
End Sub
Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
txtEmployeeTotal = 0
End Sub
-----------------------------------------------------------
I do not have the "Keep Group together" feature enabled. What happens is, whenever an Employee's details are broken across two pages, it adds the wage from the previous page twice, so the txtEmployeeTotal field displays a sum that has the one wage field added twice.
I tried to fix this by enabling the "keep group together" feature, and when I did this it added the txtManagerTotal field to itself twice, so that now the txtManagerTotal field is twice what it should be.
Any ideas on how to fix this? I would greatly appreciate it, this is driving me crazy.
Thanks,
James
jameswhited@lycos.com
-----------------------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txtManagerTotal = txtWage + txtManagerTotal
txtEmployeeTotal = txtWage + txtEmployeeTotal
End Sub
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
txtManagerTotal = 0
End Sub
Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
txtEmployeeTotal = 0
End Sub
-----------------------------------------------------------
I do not have the "Keep Group together" feature enabled. What happens is, whenever an Employee's details are broken across two pages, it adds the wage from the previous page twice, so the txtEmployeeTotal field displays a sum that has the one wage field added twice.
I tried to fix this by enabling the "keep group together" feature, and when I did this it added the txtManagerTotal field to itself twice, so that now the txtManagerTotal field is twice what it should be.
Any ideas on how to fix this? I would greatly appreciate it, this is driving me crazy.
Thanks,
James
jameswhited@lycos.com