SubReports losing fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have several reports that I placed into one main report as subreports. When
I view the reports individually, they have column labels. When I view the
main report, the subreports have no column labels.

In design view for the individual reports, all the labels appear as
"unbound". I can only assume the person who created the reports initially did
it using the wizard. But if the column labels are in the reports, why should
they disappear in the subreport?
 
The controls are probably in the Page Header section of the subreport.
Subreports don't ever display Page sections. You need to move the controls
to a group or report header.
 
I lose them when I move them.

I have no idea how they're even showing up int he page header section. The
control sources are blank, the names are head1, etc.
 
They are "column headings" but they are textboxes so they return things like
"employee ID" "District" "Monday"... but their names are "head 1" "head 3"
etc.

The reports seem to have been written in VBA. If I look at the code I can
see where it says

Private Sub PageHeader0_Format(Cancel As Integer, FormatCount As Integer)
Dim intX As Integer
Dim Colname As String

' Put column headings into text boxes in page header.
For intX = 1 To intColumnCount
If rstReport(intX - 1).Name = "1" Then
Colname = "SUN"
End If
If rstReport(intX - 1).Name = "2" Then
Colname = "MON"

And so on to name the columns. Is there a way I can just change the word
PageHeader0 to ReportHeader3?
 
I would never use that solution. You won't run any code in the On PageHeader
event of a subreport.

I expect you have a crosstab as a subrepor record source. If this is the
case, let us know more about your subreport and its record source.
 
Back
Top