Solved

Hide or Show header section or detail section based on criteria

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

776 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