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!

Passing Parameters from Visual Basic 6.0 to Crystal Reports 8.0 1

Status
Not open for further replies.

Jefftopia

Programmer
Jul 30, 2002
104
US
I have found a ton of posts on this subject but none which clearly answer my question.

This is the code I am using to call on my Crystal Report:

Private Sub mnuView2_Click()

'Run Report.
Screen.MousePointer = vbHourglass
frmRptView.Show
frmRptView.CRViewer1.ReportSource = rptWriteUp
frmRptView.CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub

frmRptView is a form I am using to view all of my Crystal Reports.

I have a parameter in my crystal report {?WU_id}. I have a text box (in the VB form from which I am calling on the CR Report) which has an identifier (txtWU_id) which I would like to use as my parameter for CR Reports.

Does anyone know how to pass this parameter from VB without prompting the user??
 
**RESOLVED**

Added the following line of code after frmRptView.Show

rptWriteUp.ParameterFields.Item(1).AddCurrentValue CInt(frmWriteUp.txtWU_id.Text)

rptWriteUp is the name of my Crystal Report

1 is an index value (I only needed to pass one parameter in this case)

CInt converts to integer

frmWriteUp is the name of the form in VB

txtWU_id is the name of a text box containing the current parameter.

Hope this helps someone :)
 
Hi Jefftopia,

just did a search on VB, CR and parameters and found your post of 30 jul 02 where you answered your own question - it helped me too and fixed my problem - so a big "thank you" for taking the time back then to post the solution.

Regards, Doug.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top