Solved

Hide or Show header section or detail section based on criteria

Posted on 2015-02-10
2
144 Views
Last Modified: 2015-02-10
I have a report on access that has a header group on part id so that it will total the quantity if there is more than one of the same part.  I also have some parts that don't have a part id and they only show in the detail section.  I have the detail section set for not visible because at first we thought there would only be parts with part ids but now there isn't.  So what I want to be able to do is hide the header group if there is no part id and show only the detail section but if there are part ids then show the header group.

Now the real problem is what is going to happen when I have a report that has part ids on some and not on others.  I hope this makes sense.
0
Comment
Question by:lrollins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40601082
Makes some sense, but it sounds like it's getting complicated.

I would take a different approach; in your query that the report is based on, assign a value for the part ID, such as "No Part ID" and allow them to group with everything else.

If you don't want to do that, possibly two subreports, one for items with PartID's and then one for those with none.

Failing that, you should be able to hide the group header with a check in the header.

To test that, just pick a condition that occurs in your report (like PartID = "XYZ") and do:

 If Me![PartID] = "XYZ" then
   Me.GroupHeaderx.Visible = False
 Else
   Me.GroupHeaderx.Visible = True
 End If

  in the OnFormat of the group header.  Part"XYZ" should end up with no group header when you test that.

  If that works, then figure out what condition(s) you want that check to work on.

Jim.
0
 
LVL 1

Author Comment

by:lrollins
ID: 40601227
That coding work.  

Thanks
Jim
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question