Click to See Complete Forum and Search --> : How to pass query from VB form to Crystal Report Designer Component
October 17th, 1999, 12:44 PM
I am a beginner programmer in VB. I have a form from which the user can query the database in Access. I am using DAO. I also want to print a report but I don't know how to pass the query from VB form to Crystal Report Designer Component or Microsoft Data Report.
If anybody has sample code or knows site where I can get help , please let me know.
My email address is
adan_10@yahoo.com
Thanks in advance.
Amendra
October 20th, 1999, 05:45 PM
It depends on on what version you are using. The newer versions of crystal allows the programmer to pass parameters in away to the report to retrive data.
The best way is to create a temp db at run time, run the query you want on the live db and update the neccesary data for the report into the temp db. Delete the temp db after displaying the report using the temp db.
Also U can use queries defined in the access database in your reports. Hope this helps you.
Amendra
October 21st, 1999, 10:55 AM
hope this can help you abit.
text1.Text = tmp1
test2.Text = tmp2
tmp1 = Format(text1.text, "YYYY-MM-DD")
tmp2 = Format(text2.text, "YYYY-MM-DD")
Crystalreport1.SqlQuery = "SELECT * FROM Customer WHERE JointDate BETWEEN '" & tmp1 & "' AND '" & tmp2 & "' ORDER BY CustID ASC ", dbSQLpassThrough
CrystalRerpot1.action = 1
regards...
loader
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.