Access and Crystal Report - Create command button

G

Guest

I am using Access 2002 and am trying to add a command button to a form that
will open a report that was created in Crystal Reports XI. I keep getting
"ActiveX component can't create object" when I click on the command button.
This is what the code looks like:

Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click

Dim oApp As Object
Set oApp = CreateObject("Crystal Reports XI.Application")
oApp.Visible = True
oApp.Documents.Open "Path:\LocationofFile\ReportTest.rpt"

Exit_cmdReport_Click:
Exit Sub

Err_cmdReport_Click:
MsgBox Err.Description
Resume Exit_cmdReport_Click

End Sub

Does anyone have an idea as to how this can be done? Thanks in advance.
 

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