Group Header question

V

Vivian Carroll

In Access 2002, I have many fields including these three: Main Topic, Sub
Topic, and Sub Sub Topic. All records are assigned a Main Topic and a Sub
Topic but not all records are assigned a Sub Sub Topic (the Sub Sub Topic
field for those records is left blank).

I created a report with 3 Group Headers (Main Topic, Sub Topic, and Sub Sub
Topic) with the corresponding fields in them (the rest of the fields appear
in the Details section). When the report prints, it groups correctly and
prints the topic headings correctly - it looks great when the records that
have a Sub Sub Topic. However, when the records have a blank Sub Sub Topic,
the report puts in a blank line where the Group Header for Sub Sub Topic
goes. Is there a way (with VBA or otherwise) to specify that if the record
has nothing in the Sub Sub Topic field, not to put white space in the
report? (Something like "If Sub Sub Topic is null, then Group Header Sub Sub
Topic should not appear.)

TIA,
Vivian
 
M

Marshall Barton

Vivian said:
In Access 2002, I have many fields including these three: Main Topic, Sub
Topic, and Sub Sub Topic. All records are assigned a Main Topic and a Sub
Topic but not all records are assigned a Sub Sub Topic (the Sub Sub Topic
field for those records is left blank).

I created a report with 3 Group Headers (Main Topic, Sub Topic, and Sub Sub
Topic) with the corresponding fields in them (the rest of the fields appear
in the Details section). When the report prints, it groups correctly and
prints the topic headings correctly - it looks great when the records that
have a Sub Sub Topic. However, when the records have a blank Sub Sub Topic,
the report puts in a blank line where the Group Header for Sub Sub Topic
goes. Is there a way (with VBA or otherwise) to specify that if the record
has nothing in the Sub Sub Topic field, not to put white space in the
report? (Something like "If Sub Sub Topic is null, then Group Header Sub Sub
Topic should not appear.)


It sounds like you can just set both the subsubstopic text
box's and its header section's CanShrink property to Yes.

If that doean't do what you want, then you can use VBA ib
the header section's Format event:
Me.Section(9).Visible = Not IsNull(Me.subsubstopic)
at least I think the header would be section 9.

Another way to make a section disappear is to cancel the
Format event.
Cancel = True
 
V

Vivian Carroll

Thank you so much, Marshall!

Your following advice worked: It sounds like you can just set both the
subsubstopic text
box's and its header section's CanShrink property to Yes

Vivian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top