Open a Crystal Report from ADP (and set params)

T

TJBernard

I am sure you have seen this type of question here before,
but I have been searching and not come up with an answer
to what I was looking for. I thought maybe someone on
here has attempted this.

I know you can open a Crystal Report by adding the Crystal
Report Active X control and reference the path for the
report.

What I am looking for is passing the parameters directly
from the form to the Crystal Report (via the stored
procedure) so I don't have to use the Crystal Report
parameter window.

On the access form I can choose the stored proc parameter
and it is passed to the crystal report.

Here is what I have tried:

Dim crrpt As Crystal.CrystalReport

crrpt.ReportFileName = "Report Path"

cboTapeNumber.SetFocus
crrpt.ParameterFields(1) = cboTapeNumber.Value
crrpt.Action = 0

I get an error attempting this on line
crrpt.ReportFileName = "report path". The error I get
is "Run-time error 91", "Object or block variable not set".

If anyone has attempted this or has any ideas of how to
accomplish this, let me know.

Thank you,

TJBernard
 
T

TJBernard

I changed the code (got rid of the errors, but now nothing
happens) to the following:

Dim crrpt As Crystal.CrystalReport

Set crrpt = New CrystalReport

crrpt.ReportFileName = "Report path"
cboTapeNumber.SetFocus
crrpt.ParameterFields(1) = cboTapeNumber.Value
crrpt.Destination = crptToWindow

After this nothing happens. The focus sets correctly to
the drop down box cboTapeNumber, but that is it.

Again thank you for your time.

TJBernard
 

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