Crystal Reports OCX

G

Gsurfdude

I am trrying to run a Crystal Repors from wth in Access VBA. I have the OCX
control on a form and I have this code in a command button.
CR.UserName = "*****"
CR.Password = "*****"
CR.ParameterFields(0) = "009"
CR.ParameterFields(1) = "0156"
CR.ParameterFields(2) = BegDate
CR.ParameterFields(3) = EndDate

CR.ReportFileName =
"C:\Development\TPAS_Vehicle_Class_For_QC\Vehicle_Class_By_Site.rpt"
CR.Destination = crptToWindow
CR.PrintReport
CR.Action = 1

When it gets to the CR.Action line I get the runtime error
Error 20552 Method 'Action' of object 'CrystalCtrl' failed

Any one know why?

Thanks.
 

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