Page 1 of 1

Variables and Expressions

Posted: Wed Mar 27, 2013 9:32 am
by RDR_Norkart
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.

Re: Variables and Expressions

Posted: Wed Mar 27, 2013 11:52 am
by HighAley
Hello.

One way is to add a record in your data source.
You could try to create a Form and put there Comboboxs and add item there.

Thank you.