Topic: Filter search question

Hey guys.

Is there any way i can do an exception on search?

For instance, i have two combo boxes on a record.
I want to search for everything that is on combobox1, but if combobox 2 has a value of 2 for instance, it can show up on that same record if combobox1 has a different value than the search button)

Eg:.

I want to search for people that live in Lisbon only
But if there's someone that lives in oPorto city, but is visiting Lisbon, i want it to show up on that search too...

ComboBox 1 - Lisboa , Porto, Braga , Etc....
ComboBox 2 (Visiting) - Lisboa, Porto, Braga, Etc...

IF Combobox1 - (not lisboa) and Combobox 2 Lisboa then show record.


How do i put this in real practise?

Re: Filter search question

Hello,


Please attach your project, I want to see your database structure.

Dmitry.

Re: Filter search question

hi Dmitry, i don't have a project per say, i'm just exploring , i got a customer who wants a database but since i'm a lamer programmer i'm trying to do what he wants in Visual Database, if i can do it i'll buy the program , make the database, and earn a little bit in the process..

I managed to get a work arround by doing this:

SELECT
test.id,
test.id_names


FROM
Assistencia




WHERE

(CASE WHEN {cbcriado} = 1 THEN test.id_Local = 1 and test.id_Local1 = 2 ELSE 1=0 END) or
(CASE WHEN {cbcriado} = 1 THEN test.id_Local = 2 and test.id_Local1 = 1 ELSE 1=0 END) or
(CASE WHEN {cbcriado} = 1 THEN test.id_Local = 1 and test.id_Local1 = 1 ELSE 1=0 END)

But, for instance, in test.Id_names i only see the ID of the table , not the name itself.
If i remember , i had to use something like Left outter join, but i can't remember the code correctly so when i do a sql query search i end up with a correct table.

Re: Filter search question

Just create test project with test data, and attach this, I'll try to help you.

Dmitry.

Re: Filter search question

Okay thanks Dmitry, just need to finish a few things, also i have been wanting to buy Visual Database for a long time, i'm sick of using virtual machines and changing the clock all the time so i can use it in trial mode smile