Suppressing Report Headers or How to Report/DisplayParent/Child/Granchild relationships

M

mark.wolven

Ok, So, what I have done is create a set of tables that hold data
about terms and their definitions. Each term (except the root term)
have a parent. There are 5 tables: Root, Grandparents, Parents,
Children and Grandchildren. The children of grandparents are stored in
the Parents table, etc.

So, I've created queries to rejoin all of this a table where the root
and its metadata are in column 1-3, grandparents in 4-6, parents in
7-9, children in 10-12 and grandchildren in 13-15. The problem is that
not every parent has a child. So, in the query results there are empty
cells/values, that's OK - it's correct.

So, now I make a report to display all the terms and their metadata. I
have set 3 grouping levels, starting with Grandparents, then Parents,
then Children, with grandchildren in the Detail section....

However, when I make a report to display all of this information, it
doesn't suppress the empty cells. It shows the header info and the
label information even if there is no data for that grouping or at
that level of detail.

Can anyone suggest a fix or workaround? Or, how would you display
information like this?
 
M

Marshall Barton

Ok, So, what I have done is create a set of tables that hold data
about terms and their definitions. Each term (except the root term)
have a parent. There are 5 tables: Root, Grandparents, Parents,
Children and Grandchildren. The children of grandparents are stored in
the Parents table, etc.

So, I've created queries to rejoin all of this a table where the root
and its metadata are in column 1-3, grandparents in 4-6, parents in
7-9, children in 10-12 and grandchildren in 13-15. The problem is that
not every parent has a child. So, in the query results there are empty
cells/values, that's OK - it's correct.

So, now I make a report to display all the terms and their metadata. I
have set 3 grouping levels, starting with Grandparents, then Parents,
then Children, with grandchildren in the Detail section....

However, when I make a report to display all of this information, it
doesn't suppress the empty cells. It shows the header info and the
label information even if there is no data for that grouping or at
that level of detail.

Can anyone suggest a fix or workaround? Or, how would you display
information like this?


Typically, the CanShrink property is used to reclaim the
space from text boxes with a Null or zero length string
value.

If that's not sufficient for your report, then use a little
VBA code in the section's Format event procedure:

Cancel = Nz(somefield, "") = ""
 
M

mark.wolven

Typically, the CanShrink property is used to reclaim the
space from text boxes with a Null or zero length string
value.

If that's not sufficient for your report, then use a little
VBA code in the section's Format event procedure:

Cancel = Nz(somefield, "") = ""

I like the Can Shrink, but I want to not display the entire section,
so, I went with this code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Nz(qry_4_GrandChildrenDescr.TermName, "") = ""
End Sub

Which then gives me:

Run-Time error '424': Object Required
 
M

mark.wolven

Typically, the CanShrink property is used to reclaim the
space from text boxes with a Null or zero length string
value.

If that's not sufficient for your report, then use a little
VBA code in the section's Format event procedure:

Cancel = Nz(somefield, "") = ""

I wish the shrink property would work for me, but I've got a handful
of fields, and labels as well as a graphical element.

I added the following code as an [Event Procedure]

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Cancel = Nz(qry_4_GrandChildrenDescr.TermName, "") = ""

End Sub

But I get a Run-Time error '424' Object Required - which gives me no
idea how to fix it.
 
M

mark.wolven

I wish the shrink property would work for me, but I've got a handful
of fields, and labels as well as a graphical element.
I added the following code as an [Event Procedure]
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Nz(qry_4_GrandChildrenDescr.TermName, "") = ""
But I get a Run-Time error '424' Object Required - which gives me no
idea how to fix it.

That message implies that Access can not resolve the name
qry_4_GrandChildrenDescr

The "somefield" I used reprsents either the name of a text
box in the section or a record source field.

--
Marsh
MVP [MS Access]- Hide quoted text -

- Show quoted text -

That's it....

It couldn't resolve the qry_4_GrandChildrenDescr.TermName - but when I
replaced it with only the TermName part it works like a charm.

Thanks
 

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