Subject Passing parameters from form to report
From Bob grimes <Bandgtshirts@aol.com>
Date Mon, 08 Feb 2016 18:05:53 -0500
Newsgroups dbase.getting-started

I am struggling with sending / making available parameters to a report in Order to filter the report.
I have successfully run a number of reports by using a public memory variable set up and given a value in the calling form using an SQL property statement such as the one below

Sql = ' select * from "feedetails.dbf " where feedetailsid = ' + feedetailsidx

Where  feedetailsidx is a public memory variable . The above works fine without any problems.

My problem is that I cannot however get it to work with more than one memory variable in one SQL statement. For instance when I want to filter an account statement from the bought ledger for one supplier and with a start date and an end date.
I can filter a table by typing the following in the command window

Select * from bought_ledger where supplier_id = : supplieridx and date >= : startdate and date <= : end date
Where supplieridx , startdate and enddate are all memory variables.

But it will not work in a report. I have tried saving all of the text following  'where' into one memory variable called say parameter_string and then using
Select * from " bought_ledger" where &parameter_string and that works fine in the command window but again it does not work in the report.
I have also tried setting up a parameters array and using that in the do statement with a 'with' .
But have failed to make that work.
I have scoured both of Ken mayers books , dbl language reference and the user guide and failed to find an explicit and complete explanation of how to pass memory variables from a form to a report.
There are many places where it is said that parameters can be passed from forms to reports but I can't find an explanation Of how to do it.
I found kens method of opening an instance of the report in the form and then controlling the report from within the form as also suggested in other postings but that seems a complicated way to do it.
Please can anybody point me in the right direction