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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing multiple values into a parameter in Crystal Reports 8.5

Status
Not open for further replies.

cwolgamott

Programmer
May 29, 2002
69
US
Hello. :) I am currently trying to write a Visual Basic 6 program to print a Crystal Report. I need to pass two parameters. The first one just passes one value, and that works fine. However, I need to pass multiple values from a table into a parameter in a Crystal Report from the visual basic program. I need to create a loop to grab the fields I need from a recordset and pass them into the crystal report as a parameter. I use the Crystal Report control that is installed in visual basic when you install Crystal Reports 8.5. Then, I set the report file name to the location of the report, connect to the database I am using and create a recordset. Then I use the following code to loop through the recordset to put the fields I need into a text box and pass those values as a parameter into the report:

myRecordset.MoveFirst
Do While Not myRecordset.EOF
txtSOComment.Text = txtSOComment.Text + myRecordset!S1COM
myRecordset.MoveNext
Loop

cr.ParameterFields(0) = "sonumber;" & txtSONum.Text & ";true"
cr.ParameterFields(1) = "socom;" & txtSOComment.Text & ";true"

The report will not print or display if I have more than three values in the text box that I am trying to pass as a multi line parameter. I would appreciate any comments or suggestions on how to solve this problem. :) PLEASE HELP. :) Thank you. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top