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

Entering multiple string parameters?

Status
Not open for further replies.

gabster

Programmer
Oct 23, 2001
192
US
Can please someone tell me how can I enter multiple string values to be passed to a parameter in CR?

I started out with this code, but I got lost:

CustomerReport.ParameterFields(1).EnableMultipleValues = True

Thanks a lot,
Gabi.
 
Multiple values can be passed through the AddCurrentValue method of the ParameterFieldDefinition object.

For Example:

'crxRPT is the name of the report object.
'ParameterFields(1) references the first parameter in the ParameterFieldDefinitions collection.

'Enable multiple values for the parameter
crxRPT.ParameterFields(1).EnableMultipleValues = True

'Pass three separate parameters to the parameter field.
crxRPT.ParameterFields(1).AddCurrentValue "Canada"
crxRPT.ParameterFields(1).AddCurrentValue "USA"
crxRPT.ParameterFields(1).AddCurrentValue "UK"
 
Here is a question...

What if I never know how many of these multiple parameters are entered. I am thinking of some sort of a dynamic coding that does this.

Thanks again,
GAbi.
 
You're going to have to know somehow. Perhaps you'll have a multi-select listbox in VB and you'll have to loop through the items in the listbox checking to see if each one is selected. For each one selected, you do a .AddCurrentValue.
 
Thanks a lot...

Here is another one on parameter fields:
How do I reference a parameter that resides in my subreport in VB code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top