Access World Forums

Access World Forums (
-   Crystal Reports (
-   -   Coding for connection and data binding (

Ryobi 05-04-2019 09:29 PM

Coding for connection and data binding

I am using 2017. I have created a crystal report and connected an msaccess database to the report and have added fields using the connection on the crystal report. I would like to code the connection my self since the I want the database to place in different place in case I want to put in different folders.
The problem that I have is where do I put the code. I do not see any where on the crystal report form where I can place the code. Any ideas or suggestions are welcome.


Ryobi 05-07-2019 06:52 PM

Re: Coding for connection and data binding
In case somebody is wondering how is done the code is shown below:

Dim cr As New CrystalReport1

CrystalReportViewer1.ReportSource = cr


Place above code at the load event of the Crystal Report Viewer Form.

Note: The code for loading and extracting data from the database is not shown,
but a connection to the database must be made in order to load the data into the ds.table
other wise you will get an an error because ds.Table is not defined.

All times are GMT -8. The time now is 12:04 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World