Print Page | Close Window

Run Crystal from MS Access

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9154
Printed Date: 05 May 2024 at 6:02am


Topic: Run Crystal from MS Access
Posted By: AlikY
Subject: Run Crystal from MS Access
Date Posted: 18 Feb 2010 at 9:51am

Hi! I working with Crystal 11 and MS Access 2003. I created report using Access as Database and I need run this report from the same Database sending parameters in Crystal Report.

What Code should I use on Click event of the Command Button on the form?
Please help.
Thank you.
Al.



Replies:
Posted By: jkwrpc
Date Posted: 18 Feb 2010 at 11:29am
This question is probably better directed to an MS Access developer's forum.
 
It appears you need the VBA code to put into the click event on the Access form button. Since I am not aware Access offers a viewer component which I believe such a circumstance would require the presence of   a copy of CR to run the report and while you may call up the report it would run in CR not Access. Perhaps there will be an MS Office developer who sees this post and offer up the VBA code and correct any misinformation I may have offered.
 
If you have all that sorted out you can pass parameters to the CR report object. The parameters exist in a collection and I believe you can reference them by name or index number. I dont have the reference in front of me, but I have done this in .Net. If you look on the web you should be able to find the syntax needed for VB and then port it the appropriate Access/VBA code.
 
Here is a .Net example
http://vb.net-informations.com/crystal-report/vb.net_crystal_report_parameter_integer.htm - http://vb.net-informations.com/crystal-report/vb.net_crystal_report_parameter_integer.htm
 
Here is another
http://p2p.wrox.com/crystal-reports/7798-passing-parameters-crystal-reports-runtime.html - http://p2p.wrox.com/crystal-reports/7798-passing-parameters-crystal-reports-runtime.html
 
 
Perhaps they will get you pointed towards what you need.
 
Regards
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: AlikY
Date Posted: 19 Feb 2010 at 5:55am

John, Thank you very much for quick respond.




Print Page | Close Window