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

Can you define a report where you only include selected subreports? 1

Status
Not open for further replies.

nowickil

Programmer
Dec 11, 2002
31
US
I am working on a basic contract "shell" report for a client. The contract will vary depending on the services the customer chooses and the payment terms they choose. I want to create a basic report template for the majority of the contract that will remain constant. My problem comes with the payment terms. The way the customer wants the various payment terms laid out is most easily resolved by using a separate subform for each payment method. (i.e one subform for capitated arrangement, one subform for capitated utilization based arrangements, one subform for fee for service arrangements, and one subform for case rate arrangments. ) I would like to use vb to set up a variable that contains the name of the subform I want to print, then just print that subform. Is there a way to do this?

Thanks in advance,

nowickil
 
If you can identify which Payment Method is applicable from the form launching the report then you can use that information in the reports formatting as it is built.

You can use this to specify the subreport to be used and the recordsource that will be required
 
Trendsetter, thanks for your reply. I got pulled away from this project due to some other client emergencies, but I'm back at it again now.

I can identify which Payment Method is applicable from the form launching the report. I don't know how to use that information in the report's formatting as it is built.

My recordsource for the report is already defined - it is a query that pulls together the contract details from multiple tables. I'm not sure how to specify the subreport to be used. Can you give me a little more detail?

Thanks much,

nowickil
 
In the Format Report section you could use a Select/Case block to identify the contents of specific control on the initiating form and then set the Case to use the sub-report specific to the payment method indicated on the form.

This requires that each payment method has it's own sub-report but from what you say you have already done that.

Good luck..
 
Thanks, I understand now. I'll post again later and let you know how it goes.
 
Trendsetter,

Well, almost a month later but I've finally finished up this project.

From the main report, on open, I used this statement to set the name of the subreport:

Me!FeeSubReport.SourceObject = "Report." & SubReportName

where FeeSubReport is the name of the control for the subreport.

It works very well, and I thank you for your time.

nowickil
 
Well done - you've worked hard on this!!

Why are learning curves so steep???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top