Variables and Expressions
Posted: Wed Mar 27, 2013 9:32 am
I have a table or Query in my report with these fields:
Name, Country, Ship
I create 2 Variables PickCountry and PickShip to show two comboboxes for Country and Ship.
The comboboxes show all the countries and all the ships in my table.
The filter-expressions look like this: (MyTable.Country == PickCountry)
So far so good… I can choose a Country and a Ship and the result in the report is Ok.
But now I only want to choose a Country and not a specific Ship.
Or.. a Ship and not a specific Country.
I could create 2 boolean Variables to show 2 Checkboxes: AllCountries and AllShips.
In my filter-expressions I would write something like this
(MyTable.Country == PickC ountry || AllCountries)
But this is not very userfriendly and what if I had 4 comboboxes. Then I also need 4 checkboxes.
So the question is:
Is it possible to add an Item “All countries” in my country-combobox. And what should I write in my filter-expression:
IIf PickCounty != “All countries” then MyTable.Country == PickCounty….??
Or… what with a checkbox as a part of a combox to enable and disable the combobox.
Name, Country, Ship
I create 2 Variables PickCountry and PickShip to show two comboboxes for Country and Ship.
The comboboxes show all the countries and all the ships in my table.
The filter-expressions look like this: (MyTable.Country == PickCountry)
So far so good… I can choose a Country and a Ship and the result in the report is Ok.
But now I only want to choose a Country and not a specific Ship.
Or.. a Ship and not a specific Country.
I could create 2 boolean Variables to show 2 Checkboxes: AllCountries and AllShips.
In my filter-expressions I would write something like this
(MyTable.Country == PickC ountry || AllCountries)
But this is not very userfriendly and what if I had 4 comboboxes. Then I also need 4 checkboxes.
So the question is:
Is it possible to add an Item “All countries” in my country-combobox. And what should I write in my filter-expression:
IIf PickCounty != “All countries” then MyTable.Country == PickCounty….??
Or… what with a checkbox as a part of a combox to enable and disable the combobox.