Solved

Hide or Show header section or detail section based on criteria

Posted on 2015-02-10
2
141 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
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

839 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