Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using multi-select Parameter values in a text box

Using multi-select Parameter values in a text box

Using multi-select Parameter values in a text box

I have a parameter where the user can select one or more options from a dropdown list of District Names, the value returns the District's code number. I want to then take whatever they selected and populate a text box at the top of the report. I already have some parameters on the report that I am using in text boxes (start and end date range values that the user inputs), and they work just fine, but they are single value.

First issue:
When I try the same in the expression as the date ranges with the multi-select parameter, only the code for the first District is returned. Is there a way to return multiple values?
Expression: =Parameters!DistrictCodes.Value(0)

Second issue:
I tried using Switch to convert the District Code to the District Name but even though I didn't receive any errors in the expression, when I ran the report, selected a District, only '#Error' appeared.

Thank you for any assistance!

RE: Using multi-select Parameter values in a text box

I have a canned report from a vendor and they put the following code in the report (I have analyzed the code, so I can just tell you how it used).

Function ParameterList(ByVal Parameter As Object) As String
Dim sParamItem As Object
Dim sParamVal As String = ""

For Each sParamItem In Parameter
If sParamItem Is Nothing Then Exit For
sParamVal &= sParamItem & ", "

Return sParamVal.SubString(0, sParamVal.Length - 2)
End Function

then called from an expression like this. =Code.ParameterList(Parameters!Offices.Value). So it looks like in your case you would replace the Parameters!Offices.Value with Parameters!DistrictCodes.Value.

RE: Using multi-select Parameter values in a text box

Thank you, kray4660! I'll talk to the developer that wrote the stored procedure to see if he can add this. :)

RE: Using multi-select Parameter values in a text box

The code would be embedded into the report. Right click on the report (make sure you get report properties), select Code, and enter the function above.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close