I am using VB6/Crstal 8. I am passing a selection formula to the report. "x" is a variable taken from a text box in another form. Another preview command button on that form launches the crytsal report form.
I enter a number in the text box, click the preview button, the Crystal form launches and displays the form with selected information - BUT ONLY ONCE!
I close the Crytsal form, put another value in the text box, click preview button, Crystal form launches, but the details are blank. Repeated tries of other values still bring up blank data, except for the value first tried. Entering the value first tried displays the correct data on the form.
Is there a refresh command I must use when passing formula data to Crystal? I thought each time the form is launched, it is new and data should be automatically refreshed?
Thanks in advance for your help.
CODE USED:
----------------------------------------------------------
Private Sub Form_Load()
'converts textbox value to integer.
x = CInt(Val(RerpotTest.Selection.Text))
'pass selection value determined by "x" to report
Report.RecordSelectionFormula = "{Products.PRdID} =" & x
'launch report viewer
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Screen.MousePointer = vbDefault
CRViewer1.ViewReport
End Sub
----------------------------------------------------------
I enter a number in the text box, click the preview button, the Crystal form launches and displays the form with selected information - BUT ONLY ONCE!
I close the Crytsal form, put another value in the text box, click preview button, Crystal form launches, but the details are blank. Repeated tries of other values still bring up blank data, except for the value first tried. Entering the value first tried displays the correct data on the form.
Is there a refresh command I must use when passing formula data to Crystal? I thought each time the form is launched, it is new and data should be automatically refreshed?
Thanks in advance for your help.
CODE USED:
----------------------------------------------------------
Private Sub Form_Load()
'converts textbox value to integer.
x = CInt(Val(RerpotTest.Selection.Text))
'pass selection value determined by "x" to report
Report.RecordSelectionFormula = "{Products.PRdID} =" & x
'launch report viewer
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Screen.MousePointer = vbDefault
CRViewer1.ViewReport
End Sub
----------------------------------------------------------