Counts in report header

  • Thread starter Thread starter Darhl Thomason
  • Start date Start date
D

Darhl Thomason

I have my report header list how many records of each type (i.e. Scheduled,
Standby, Pending, Completed, NoPOS) there are listed in the report. I have
an unbound text box for the first number that correctly counts the # of
Scheduled stores. =Abs(Sum([StatusName]="Scheduled")). But I cannot get
the rest of the counts to appear correctly. I know I could put additional
unbound text boxes and have it calculate the same way, but the header is
dynamic based on what criteria on my form are selected. The sub that
finishes creating the header is:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
strReporttitle = strReporttitle & "Scheduled"
If Forms!frmStoreData.chkStandby = True Then
strReporttitle = strReporttitle & " and Standby"
End If
strReporttitle = strReporttitle & " Stores"
txtReportTitle = strReporttitle
End Sub

I only have it looking for Standby stores at this point because I want to
get it working before I go too far forward with it.

Thanks!

Darhl
 
If you add a grouping by type to the report, you should be able to use that
to create headers rather than having to code extensive If statements. You
can have the group start a new page and you can set it to repeat the header
on subsequent pages.
 
Hmm, that's not a bad idea. I'll see if I can work that out.

Thanks,

Darhl


Pat Hartman(MVP) said:
If you add a grouping by type to the report, you should be able to use
that to create headers rather than having to code extensive If statements.
You can have the group start a new page and you can set it to repeat the
header on subsequent pages.

Darhl Thomason said:
I have my report header list how many records of each type (i.e.
Scheduled, Standby, Pending, Completed, NoPOS) there are listed in the
report. I have an unbound text box for the first number that correctly
counts the # of Scheduled stores. =Abs(Sum([StatusName]="Scheduled")).
But I cannot get the rest of the counts to appear correctly. I know I
could put additional unbound text boxes and have it calculate the same
way, but the header is dynamic based on what criteria on my form are
selected. The sub that finishes creating the header is:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
strReporttitle = strReporttitle & "Scheduled"
If Forms!frmStoreData.chkStandby = True Then
strReporttitle = strReporttitle & " and Standby"
End If
strReporttitle = strReporttitle & " Stores"
txtReportTitle = strReporttitle
End Sub

I only have it looking for Standby stores at this point because I want to
get it working before I go too far forward with it.

Thanks!

Darhl
 
Back
Top