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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Source Object of Subreport based on field

Status
Not open for further replies.

kmclane

Technical User
Apr 14, 2004
321
US
I need to check a boolean field in a table and change the source object of a subreport based on whether it is true or not. I also have another subreport that I need to make invisible based on another boolean field. I have the fields added to the query for the main report and tried an if statement, but that didn't work, I tried adding an invisible field to the form, but that seemed to evaluate the same way no matter which way it was set in the underlying table. I would appreciate any help.
Thanks, Ken

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
I would add both subreports to the main report and make one visible and the other invisible based on the value of the boolean field. The boolean field must be bound to a control on the report.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
That's exactly what I ended up doing, the extra benefit being that if a subreport is invisible, it takes up no space. I now have two subforms changing places when needed, and another that only displays when needed. I keep thinking I'm done with this report, and they keep pulling the old "but I need it to do this too". So far so good. Just a few more "new" things to add to my disappearing subreport. The really fun part has been reaching correct totals depending on which forms are diplayed at any given moment.
Ken

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top