cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a value to a Parameter Field From a VB Form

Former Member
0 Kudos

Post Author: as1971

CA Forum: General

Hello everyone

I'm using Visual Basic 6.0 and Crystal Report 9.0

I built a report using Crystal Report and named it Player_Statement.rpt. I then included it to my VB project and named it Player_Statement.Dsr

In this report I have a Parameter Field called P_Player_ID which I'm using in Record Selection Formula.

I'm using the following code to pass a value to the parameter:

Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue CLng(cmbPlayerNB.BoundText)

When I execute the application I get the error message "The value or range you are adding has already existed" at the last line of code (Where I'm assigning the parameter a value)

Could anybody help me please

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Post Author: VinoTinto

CA Forum: General

Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.GetItemByName("P_Player_ID").ClearCurrentValueAndRange Report.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue = CLng(cmbPlayerNB.Boundtext)