Complex Find Filters, example: ((A Or B Or C) And D)

J

Jim

Hello,

I know how to implement an OR based find filter 'A Or B':

strFilter = _
"[Business Phone] = """ & strNumber & """ Or " & _
"[Home Phone] = """ & strNumber & """"

and I know how to implement an AND based find filter 'A And B':

strFilter = "[FullName] = """ & strName & """ And " & _
"[BusinessTelephoneNumber] = """ & strNumber & """"

But how do I specify an '((A Or B Or C) And D)' find filter?

I want to select a Contact item that matches any one of several
Contact phone number fields against a value, and that also matches
against a name field.

Conceptually (with the quotes removed for readability), this would be
something like:

strFilter = _
[ [Business Phone] = strNumber Or
[Home Phone] = strNumber Or
[Mobile Phone] = strNumber Or ]
And
[ [FullName] = strName ]

If this is possible, I would appreciate a minimal code snippet that
shows compilable syntax, with quotes/etc.

Am I thinking about this right, using the find filter? Or should I
just write code to search the Contact folder myself, where I have full
control and can get as fancy as I want with selection logic?

If the find filter will support complex searches, I assume that it is
somehow more efficient than coming back to my Add-In for processing
for each Contact item in the folder. Is that correct? Is there real
merit in pursuing a find filter based solution?

Thanks.

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top