S
SuzyQ
I have the code below in the format section of a report
Me.txtTotalEmp is an unbound control should display the total of a specific
employee. My problem is that if the report for a single employee spills over
to a second sheet, me.txtTotalEmp printed is 0 while the single sheets totals
are correct for the employee, but if I put the code in the _print section of
the employee footer, then sometimes the total amount is outrageously
incorrect on some employees and correct on others. How can I correct the
problem? What is the best practice for determining when to use "on format" or
"on print" events.
Private Sub GroupFooter1_format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ErrorRoutine
Me.txtTotalEmp = dblEmpHours
dblTotHours = dblTotHours + dblEmpHours
dblEmpHours = 0
Exit_Sub:
Exit Sub
ErrorRoutine:
Call LogError(Err.Number, Err.Description, "Report: rptPayrollDetail;
Sub: GroupFooter1_Format", , True)
Resume Exit_Sub
End Sub
Me.txtTotalEmp is an unbound control should display the total of a specific
employee. My problem is that if the report for a single employee spills over
to a second sheet, me.txtTotalEmp printed is 0 while the single sheets totals
are correct for the employee, but if I put the code in the _print section of
the employee footer, then sometimes the total amount is outrageously
incorrect on some employees and correct on others. How can I correct the
problem? What is the best practice for determining when to use "on format" or
"on print" events.
Private Sub GroupFooter1_format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ErrorRoutine
Me.txtTotalEmp = dblEmpHours
dblTotHours = dblTotHours + dblEmpHours
dblEmpHours = 0
Exit_Sub:
Exit Sub
ErrorRoutine:
Call LogError(Err.Number, Err.Description, "Report: rptPayrollDetail;
Sub: GroupFooter1_Format", , True)
Resume Exit_Sub
End Sub