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

Limit SubReport from printing 1

Status
Not open for further replies.

JW61

Programmer
Mar 13, 2007
14
US
I have a report that has three different sub-reports. The report prints information for suppliers. I would like to be able to determine which subreports print based on a value stored in a table for that supplier.

Sub-report 1 will print for all suppliers but I would like to be able to limit 2 and 3. The values will always be in order. In other word if sub-report 3 prints then 1 & 2 will also be required but I can have 1 & 2 and not 3.

I have the data like:

Supplier Sub-Report
AAAA 2
BBBB 1
CCCC 3

Can someone tell me the best way to accomplish this?
 
I expect you could use code in the On Format event of the section of the main report containing the subreports.
Code:
Me.subrptOne.Visible = (Me.txtSubReport >= 1)
Me.subrptTwo.Visible = (Me.txtSubReport >= 2)
Me.subrptThree.Visible = (Me.txtSubReport >= 3)

Duane
Hook'D on Access
MS Access MVP
 
Sorry it took me so long to reply. I've had family issues and had not had a chance to test your solution.

Works great. Thanks and a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top