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

Parameter Field in Record Selection 1

Status
Not open for further replies.

varakal

IS-IT--Management
Mar 18, 2004
114
US
I have a parameter field. Lets say it is CountryName. When I enter a CountryName, it should match that countryname from the database. We can do that with
{Country.CountryName} = {?CountryName} in record selection.

Example, if we give {?CountryName} as USA, then it diplays the rows only with Country Name as USA.

But if I donot enter any thing for the CountryName parameter field, then it should display the records with ALL country names.
How to do this?
 
It is better if you make the default value for the parameter as "ALL".

You can then put something like this in your records selection formula:
Code:
(if {?CountryName} <> "ALL" then
    {Country.CountryName} = {?CountryName}
else if {?CountryName} = "ALL" then
    TRUE)

~Brian
 
ya. I got this idea.. but what if we have a country name called 'ALL'. Then it will diplay the records with country name only as 'ALL' ??
 
You could change the default value to "All COUNTRIES" or something that would never match another countty name. You can try using a blank value but I never find that very meaningful to the user.

~Brian
 
At first, thanks a lot for you reply.
The solution seems to be fine for this particular problem.

But lets say if that field is not at all a country name and it just a descriptive text field.. then what could be the possible solution?
 
Are you saying now, that you want to be able to search for a country name in a descriptive text field?
 
No. I am saying that I want to search for a text string in some other field (column).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top