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!

Solved- linking Sub report parameters to main report paramaters.

Status
Not open for further replies.

ntbs2012

IS-IT--Management
Mar 3, 2013
20
CA
I finally had success in getting this report to work.
My main report was always OK. But I needed to insert a comment into the main report, only if the comment field contained something.
So I inserted a new SR, with database fields containing the cheque comments, and invoice details. In the details portion, I inserted the invoice number and the comments, as well as the vendor and date of the cheque.
I linked on ?Vendor Name from main report, and selected data in the SR based on the
{ap_cheque_comments.apchc_comments}
I placed the SR in the report footer of the MR.
Then I added 2 parameters in the SR that duplicated the ones in the MR.
So my selection formula in the MR is:
{ap_invoices_details.apid_supplier_id} = {?Vendor Number} and
{ap_invoices_details.apid_ref_num} = {?Cheque number}and {ap_invoices_details.apid_trans_date}={?Cheque date}
and in the SR:
{ap_invoices_details.apid_trans_date}={?Cheque date} and
{ap_invoices_details.apid_supplier_id}={?Vendor Number}

Now, the user has to enter some of the data twice in the initial Enter Values screen, (the date and vendor), but the report returns exactly the information that I need. In retrospect, it all seems simple, but I've danced around this thing for months, with excellent suggestions from Ian and others at other sites.
So the key was having duplicate parameters in the SR.
thanks to all!
Norm
 
I must admit I don't really understand your post, but I would be very surprised if the only way to achieve what you need is to have the user enter the same piece of data twice.

I am probably missing something here but why wouldn't you just pass the Parameter from the main report through to the sub-report Parameter?

To do this, go into "Change Sub-report links", double click the relevant parameter from the Available Fields list on the left to send it to "Field(s) to link to on the right" and in the Field link at the bottom left select the corresponding Parameter you created in the sub-report.

Anyway, hope this helps.

Pete
 
Thanks for your reply, Pete. Originally, I did what you suggested, but without 2 parameters that matched the Main Report, I just couldn't get the comments to display correctly. Once I had 2 parameters to match the Main Report, all worked fine.
I just kind of stumbled on a solution, and I'm not saying that this is the best or only way it can be accomplished. However, I'm happy that everything works for the user even if she has to enter some data twice.
regards,
Norm
 
Hello Norm,

I'm not sure if I understood your comments.

But here is what I would suggest

If you follow what Pete suggested the uer doesn't have to enter the values twice.
The main report parameter values will be passed to the sub report.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top