Link to home
Create AccountLog in
Avatar of robthomas09
robthomas09

asked on

Visual Studio 2005 Dynamic Parameter passing

Hello experts,  noobie here at VS2005, so I apologize in advance.

I have a script where the user must choose a practice name, and then I would like to filter the next parameter to show only provider based in that practice at run-time.

So, I have:
Table: order
id                  practice_name             doc
1                   Main st                         Smith
2                   Main st                         Jones
3                   Canal st                        Parker


my script:

select id, practice_name, doc
from order
where practice_name = @Practice_Name


My @Practice_name is a dataset query which is:
select distinct practice_name from practice

and my @doc is a dataset query which is:
select distinct doc from providers

I would like to, in theory, have my @Doc variable be dependent on what is chosen in my @practice_name variable.  Something like:

my @doc would a dataset query which is:
select distinct doc from providers
where doc_practice = @practice_name

So in the parameter drop-down when you run the report, if you chose "Main St" as your practice, you would get only "Smith" and "Jones" in your drop down to choose from.

How can I go about configuring that?

Thanks!
SOLUTION
Avatar of liija
liija
Flag of Finland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of robthomas09
robthomas09

ASKER

Thanks!