I'm using the Crystal Active X Control, not the CRViewer. In order for me to get the report to refresh, I have to put in code a reference to the refresh button in Crystal:
With CrystalReport1
.ReportSource = crptReport
.ReportFileName = objRec!ReportLocation
If cboMonth <> "" And cboYear <> "" Then
.SelectionFormula = "{" & strReportName & ".MONTH} = '" & cboMonth & "'" & _
"AND {" & strReportName & ".YEAR} = '" & cboYear & "'"
End If
If cboQTR <> "" Then
.SelectionFormula = "{" & strReportName & ".QUARTER} = " & cboQTR & ""
End If
.WindowState = crptMaximized
.Destination = crptToWindow
.Formulas(0) = "Title = '" & objRec!ReportName & "'"
.WindowShowRefreshBtn = True
.Action = 1
End With
which isn't the most efficient way to refresh the report because it requires the user intevention. I want the report to refresh automatically. How would I incorporate the CR Viewer?