×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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

RE: Disable parameter based on another parameter

RE: Disable parameter based on another parameter

RE: Disable parameter based on another parameter

(OP)
Hello,

I'm not sure if this is possible but I have a parameter that you can either select "Anes" or "Sur". What I would like to do is that if "Anes" is selected then show the Parameter {?Anes} and if "Sur" is selected then show {?sur}. I would need to do this within Crystal as a formula etc.

Thanks Much!

RE: RE: Disable parameter based on another parameter

You can set up a record selection formula like this:
(
(
{?Which}="Anes" and
{table.anes}={?Anes}
) or
(
{?Which}="Sur" and
{table.sur}={?Sur}
)
)

Only the values for the selected parameter would affect the report results, but you would still need to make a selection for all three parameters, so you might want to add a selection "All" for each (or 0 for a number, with "All" as a description field), so that the selections make sense to the user. More recent versions of Crystal have "optional" parameters, so you might want to look at that functionality.

-LB

RE: RE: Disable parameter based on another parameter

(OP)
Hi LB,

Thanks for the quick response! This works but I would like to take this 1 step further. Using your suggestion I'm getting 2 parameters in the panel. One for {?Sur} and one for {?Anes}. What I would like to do is have only 1 parameter within the panel so if
{?Which}="Sur" the only show {?Sur} in the panel or if {?Which}="Anes" then only show {?Anes}. Is this possible?

Cathy

RE: RE: Disable parameter based on another parameter

(OP)
Hi LB,

I figured it out. I needed to add a calculated field to my query so If it field name like Anes then "Anes" else "Sur".

I then created a cascading parameter that if you select "Anes" then it shows the records for "Anes" else it show the records for "Sur".

Thanks for your help!

RE: RE: Disable parameter based on another parameter

You could create a union command that combine both Sur and Anes fields into one to populate the values in one parameter, e.g., {?SurOrAnes}. The user would still choose {?Which} and then select from the combined list. If they included both kinds of fields, only the selected field would be populated based on your record selection formula

(
(
{?Which}="Anes" and
{table.anes}={?SurOrAnes}
) or
(
{?Which}="Sur" and
{table.sur}={?SurOrAnes}
)
)

Another option is to write the command so that only one set of values is returned by adding the Which parameter into the where clause within each side of the union command. Then you would set up the {?SurOrAnes} parameter as a dynamic one based on the field in the command. However, when you set the field from the unlinked table to the {?SurOrAnes}, there will be two prompts, first for the {?Which} and then a second screen will appear with {?Which} and {?SurorAnes} which will populate correctly--BUT you will have to manually change the {?Which} parameter to match your earlier selection. Neither approach is particularly intuitive.

If you decide to go one of these routes, let me know if you need help with the union command.

-LB

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