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

Multiple parameters based on each other 1

Status
Not open for further replies.

teachmecr

Programmer
Oct 1, 2006
72
US
Hi experts,
i have a report that is driven by 2 parameters MainId and SubId. The reports are being generated from a view which has fields for both columns. In the report i'm only displaying SubIds with their related info. What i want is i want to have SubId as an optional paramter. So when only MainId is selected without choosing from SubId the report would display all its respective SubIds withs its info. And when a particular SubId is selected the report shoud only display that SubId.
For example MainId has 500,100 values so SubId has 501,502,503(related to MainId 500) and SubIds for 100 are 101,102. Thus when only MainId 500 is selected irrespective of selecting anything from SubId parameter it would give all its SubIds(501 502 503) on the report. And if MainId 500 is selected and then 501 is selected from SubId the report should only display the info for 501. Any suggestions of how i set up the parameters and forumula in select expert. Thank you all for your help.
 
Have 'SubId' default to "None".

Make a selection-logic boolian,
Code:
@SubId_Param = "None"
or @SubId_Param = ToText({your.IdParam})



[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
you will need tro use a conditional expression, something along the lines

Code:
{MyTable.MainID} = {?param_main} and

{If IsNull({?param_sub}) or {?param_sub} = '' Then
    True
Else
    {MyTable.SubID} = {?param_sub})

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top