Conditional Visible Group Headers

cheftim

Registered User.
Local time
Today, 10:54
Joined
Jan 22, 2007
Messages
33
Is it possible to set up a IIF command to change the visible property of a report?

I have a query that has mostly null entries and I would like to only print the fields that are not null. I figured the best way to do this would be to use Group Headers on each of the fields and then print those groups when the info is there. Am I all screwed up with this thinking or is there a possibility for this?

Thanks in advance for your ideas and suggestions,

t
 
Probably doable, but it would seem to make more sense to eliminate the nulls from the query in the first place.
 
Sorry, but I don't understand how that would turn off the Group Headers just by eliminating the nulls.

Maybe I need to clarify. I have a DB for scheduling events. It includes a number of buildings and services.

In my query I have fields for Building A, Building B, and Building C.
In the report I have Group Headings for each of the buildings.

If on a given day 1 record shows an organization using building A and another record shows a group using Building C, I don't want to print information for building B. (Each building has 50+fields of information, I don't want to list Breakfast = 0, Extra LInens = 0, etc. when it is not needed.)

I hope this helps to make my question a little bit clearer.

thanks
t
 
It wouldn't turn off the group header. There would be no data in the query to hide. In your example, you'd only return the records for building A & C. 2 records returned instead of 3, thus nothing needing to be hidden.
 
There are other comments, etc. in the group header of the form. Things such as....

The [groupname] will depart today at [departuretime]

Even if the infromation in this line is null, there will be a line printed. This is what I am trying to accomplish by making the Group Header invisible when no data is present.

Thank you for your comments - but still looking for a way to accomplish my task.
 
Oh, it's not difficult. You'd use VBA in the format event of the appropriate header. Test the value with an If/Then statement, and this type of thing:

Me.GroupHeader0.Visible = False

Any of the sections can be controlled this way.
 
Thank you Thank you Thank you! I think that's just what I needed. I'll try it first thing tommorrow morning!

I need to research how to do this in VBA - I've only used IIF in Access, but it is the "Me.GroupHeader0.Visible = False" thing that I think I was missing.
 

Users who are viewing this thread

Back
Top Bottom