My report in Access 2003 has a groupheader in it whose fields are empty for some records and not for others. In the OnFormat event of the header I put the following code:
If IsNull(Field1) Then
Me.GroupHeader1.Visible = False
Else
I put the code in hoping to save pages of the report. If the header has no data it won't appear and the data printed below it would move up on the page. The problem, I believe, is the entire report is formatted before printing and thus if line 10 has data in Groupheader1 the first 9 lines Groupheader is not shown but line 10 makes it visible for the entire report thus empty space where GroupHeader1 would be for the first 9 lines.
Finally a question. Does the Groupheader have to appear for every record just because it has data for one record?
Apologizes for the long winded explanation.
If IsNull(Field1) Then
Me.GroupHeader1.Visible = False
Else
I put the code in hoping to save pages of the report. If the header has no data it won't appear and the data printed below it would move up on the page. The problem, I believe, is the entire report is formatted before printing and thus if line 10 has data in Groupheader1 the first 9 lines Groupheader is not shown but line 10 makes it visible for the entire report thus empty space where GroupHeader1 would be for the first 9 lines.
Finally a question. Does the Groupheader have to appear for every record just because it has data for one record?
Apologizes for the long winded explanation.