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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a crystal .rpt file from access2000 form button 3

Status
Not open for further replies.

GotFish

Programmer
Dec 27, 2002
7
US
Is it possible (ie...relatively easy) to call a crystal report from an access2000 form (either button, or from switchboard menu item? I am rather new to access forms, but familiar with low/moderate vb code....anyone have an example?
 
Place a Crystal reports control on a form.
Set it's ReportFileName property to the file name of your crystal report.
Place a button on the form.
In the onclick event for the button type this code:

'cmdOpenReport is the name of your button
Private Sub cmdOpenReport_Click()
'Action Code 0 will open the report in preview
'Action Code 1 will print the report to a printer

CrystalReport1.action = 0
'Where CrystalReport1 is the name of the control

End Sub

Cheers

Anthony

 
Thanx.... This works a treat. If you could add the passing of parameters for example to select only details of a field on the current form i would be most grateful It is better to ask for for directions rather than wander blindly... Where am I and why did I ever get into I.T. :)
 
Okay, I understand this, makes sense. But, when I try to put the crystal report control on the form it says:
"Thr OLE Server Isn't registered, to register the OLE server, reinstall it"...what does that mean, and how do I do that? Thanks immensely for your help Anthony..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top