Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interactive report to show/hide sub-report

Status
Not open for further replies.

BallunarCrew

Programmer
Sep 3, 2006
58
US
I am working in Access 2007 and have a report that has a very large amount of data on it, grouped by one field. I am wondering if anyone has sample code that will allow me to have a button that expands a group of data rather than displaying all the data for a group at once.
Example:
What I have:
Group A
Detail line 1
Detail line 2
Detail line 3
Group B
Detail line 1
Detail line 2

What I want:
Group A btn: View Details
Group B btn: View Details

When I click the button for Group A it would expand and show the three detail lines. Same for the next group button.
I am thinking there might be a way to do this with the new interactive report view.

Anybody tried this?
Thanks.
 
I am not familiar with 2010, is the interactive report view a new feature? I could not find anything on it? The only thing I can think (without knowing 2010) is a tree view control, but that is for a form. And if each row has lots of fields, that would not be a good option either. Have you looked into Crystal Reports. I am pretty sure that type of functionality exists and you could post in that forum.

If no one comes up with a solution, I could try to fake it. This would be my approach. I would use shortcut menus (right click) as my control. As a page loads it would load the shortcut menu with the records that are on that page. Each record would have a checkbox by it ( this is a menu bar property). Click to expand. Once it is expanded I would basically add the child records to the query and reload the page. so it would appear as if the records contract/expand. If you are interested in that approach, I could give it a try. Even for me I think that would be challenging, but doable. I have done something similar in a form but not a report.
 
Thanks MajP. I am in 2007, not 2010. Report View is new to 2007 and the book I have says you can make the report interactive in Report View. It can do things such as make a field on the report be a hyperlink to open a form to display more information on the report line item. That is not what I want to do though. I do not want to get into using Crystal even though I have it. I have thought of making each grouping a sub-report since I have a defined/static number of groups and then having one of the interactive buttons to either hide or show the sub-report.
As you say, I can probably fake it but hope I don't have to re-invent the wheel.
 
IMG

So what you are looking at is actually a pop up menu bar. I have discussed on the forum before how to use a menu bar as a form control. It is not simple, but doable. As you see you can check/uncheck a record. Loading the menu with the right records would be a little challenging.

You could probably tie a form to the report to control this, but it gets real complicated (at least for me) to control the positioning and sizing of a form and report at the same time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top