Solved

Hide or Show header section or detail section based on criteria

Posted on 2015-02-10
2
126 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
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
Comment Utility
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
Comment Utility
That coding work.  

Thanks
Jim
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now