Private Sub OpenReport()
On Error Resume Next
Dim SQL As String
Dim strConnect As String
' Create and bind the ADO Recordset object
Set m_Connection = New ADODB.Connection
Set adoRS = New ADODB.Recordset
' Open the connection
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\tmp.mdb;Mode=Read|Write"
m_Connection.Open strConnect
adoRS.Open "Select Table_test.*,Table_Con.*,Table_Data.* From Table_test,Table_Con,Table_Data", m_Connection, adOpenDynamic, adLockBatchOptimistic
m_Report.Database.SetDataSource adoRS
CRViewer1.ReportSource = m_Report ' other code modules can enable and disable it
' m_Report.PaperSize = crPaperEnvelope14 ' Set a visually pleasing paper size for the display
' If you're going to print the report, you should change the papersize to letter
RefreshViewer
CRViewer1.ViewReport
End Sub
Private Sub RefreshViewer()
Dim SQL As String
Dim Name() As String ' Used to help parse cboCustomerName.text
If CRViewer1.IsBusy Then Exit Sub ' Extra safety precaution
Screen.MousePointer = vbHourglass