I recently managed to find a code that displays the report for me. The code works fine when the database isn't password protected. But, when it comes to password protected, the code can't login. Any suggestions on how to modify the code to resolve that?
Here is the code I have:
VB Code:
Option Explicit Dim strRecordsFormula As String Private Sub Form_Load() Dim crReport As CRAXDRT.Report Dim crApp As New CRAXDRT.Application 'Open the Crystal Report Set crReport = crApp.OpenReport(App.Path & "\RPSM.rpt") With crReport 'Set the Access database path .Database.Tables(1).Location = App.Path & "\YFDB.mdb" End With With CRView .ReportSource = crReport .ViewReport While .IsBusy DoEvents Wend .Visible = False .Refresh End With Set crApp = Nothing Set crReport = Nothing End Sub




Reply With Quote