running reports that are bound to stored procedures

G

geraldine Hobley

Hi,
I wish to run a report called myreport from access
code (within an access adp). as it stands the report has
the bound storedprocedure and parameters embedded in it's
properties and is run as follows

DoCmd.OpenReport MyReport, acPreview
DoCmd.PrintOut
DoCmd.Close acReport, MyReport, acSaveNo

.. However I would like to run the report passing the
stored procedure and parameters to it within the code.
also the report has a subreport attached called
Mysubreport which is also bound to a stored procedure
with parameters. I also need to pass this information
within the code, Any help would be greatly appreciated.

Regards
Geri
 
K

Keith Perry

Create a Stored Procedure with the parameters that you supply, that creates a
table that mirrors the result set from your old stored procedure. Change the
report so the data source is not the stored procedure, but the newly created
table.

Then in your code use ADO to execute the stored procedure to create your
table passing your parameters in the code.
Then run your code that prints the new report based on the newly created
table.

Hope this helps,
Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top