Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing report from VB with record selection formula

Status
Not open for further replies.

scarter1

Programmer
Mar 9, 2002
14
0
0
CA
I would like to print a report directly from vb based on the selected ID number. I am very new to crystal reports so I don't know all of the components that I need.

I have included in my start up module

Global crxApplication As New CRAXDDRT.Application
Global CrxReport As CRAXDDRT.Report

Then on my print form I have included the following code:

Dim Report As CrystalReport1
Set Report = New CrystalReport1

Set CrxReport = crxApplication.OpenReport(App.Path & "\Report3.Rpt")
strSelectionFormula = "{tblcontent.orderID} = " & gCurrentID
CrxReport.RecordSelectionFormula = strSelectionFormula
Report.PrintOut

When I get to report.PrintOut I receive the error message, Server has not yet been opened. I am using VB6, MS Access 2000 and Crystal Reports 8.5. Can someone please tell me what I am missing?

Thanks in advance for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top