Solved

Hide or Show header section or detail section based on criteria

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Access 2016 Debugging 7 43
Continuous form : Prefilled Data 7 21
Acc 2010 pause execution 10 13
Access coding 2 15
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

863 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

20 Experts available now in Live!

Get 1:1 Help Now