I have created a report with 3 groupings. The header just before the detail is groupheader2. The detail area has NO header (I tried to put the header info here, but it keeps repeating, even if I set the properties to HIDE DUPLICATES.)
I have some code in detail ( on format) that hides all of the fields if there is no data in the “items” field. This works nicely. Size is set to 0, all fields can shrink, etc.
PROBLEM: sometimes the groupheader2 prints for a detail with no records. This only happens at the top of a page. Most of the time the header does not print if there is no record under its detail, which is the desired behavior.
Is there a way to reference controls or items between sections? Can I add some code that will hide or suppress the groupheader2 if there is no record in the detail?
Here is the code in the ID Header (groupheader2)
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim blnItemsPresent
blnItemsPresent = Not IsNull (Items)
[Quantity].Visible = blnItemsPresent
[Price].Visible = blnItemsPresent
[Notes].Visible = blnItemsPresent
EndSub
This part works fine. I’m looking for the code to make the header above this NOT PRINT. Maybe it’s not possible? I was also playing with putting the header info in the DETAIL area, and setting this to HIDE DUPLICATES, but it leaves a bunch of space above each row of detail.
THANK YOU ALL.