Click to See Complete Forum and Search --> : [RESOLVED] Refresh problem with CRXI and VB6
SparrowHawk7
Feb 2nd, 2009, 01:33 PM
I have several reports I'm calling from a VB6 app. The reports work fine but the data is often old requiring the user to refresh it before viewing. I've tried everything I can think of to force the report to refresh it's data on opening but nothing works .. instead I must wait for a second and hit the refresh button on the report. I've looked on the Net but no help is out there either. Surely there must be a way to do this with code or perhaps a setting on the report. Incidentally- I didn't save the data with the report.
TIA,
Ken
SparrowHawk7
Feb 17th, 2009, 09:42 PM
I guess I'll post the answer to this problem here as nobody seems to have known how to do this. I was fiddling with anything I could think of to resolve this and came across the solution.
On the report form, the boilerplate code is given as :
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
I simply put Report.DiscardSavedData before the report source was declared. This apparently forces the report to refresh it's data which is what I wanted.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.