Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection Formula in VB6/Crystal 8 - works only once - WHY?

Status
Not open for further replies.

HDer

Technical User
May 3, 2001
8
CA
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
----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top