Outlook2k and Restrict Method Problems

M

Martin

I have to user defined fields "guidparent" and "contractback" and I want to
filter the contact items for these fields. Both fields are defined on the
folder level. guidparent is a textfield and any separated filter works.
contractback is a yes/no field and any attempt to filter for the fieldstatus
"no" failed.

My restriction is
strRestrict2 = "[contractback ]= 'No'"
ctlViewContacts.Restriction = strRestrict

The result is amazing. Outlook shows all Elements which are contractback
=Yes. I couldn't manage it that outlook shows me the desired result.

How would I corectly connect the restriction filter? Does this work?

strRestrict = "[guidparent] = '" & Item.UserProperties.Find("guid").Value &
"'" & " And ""[contractback ]= 'No'"

Any Help would be appreciated!

Martin
 
J

Jeff Moore

Martin

It looks to me like you are referring to "No" like a string variable, not a bit. When working with bits 0=no and <>0 is yes. "No" is <>0, so means yes

Try one of the following and see what happens

strRestrict2 = "[contractback ]= 0

or

strRestrict2 = "[contractback ]= " & vbFals


----- Martin wrote: ----

I have to user defined fields "guidparent" and "contractback" and I want t
filter the contact items for these fields. Both fields are defined on th
folder level. guidparent is a textfield and any separated filter works
contractback is a yes/no field and any attempt to filter for the fieldstatu
"no" failed

My restriction i
strRestrict2 = "[contractback ]= 'No'
ctlViewContacts.Restriction = strRestric

The result is amazing. Outlook shows all Elements which are contractbac
=Yes. I couldn't manage it that outlook shows me the desired result

How would I corectly connect the restriction filter? Does this work

strRestrict = "[guidparent] = '" & Item.UserProperties.Find("guid").Value
"'" & " And ""[contractback ]= 'No'

Any Help would be appreciated

Marti
 
M

Martin

Jeff,

i tryed both but wether with 0 nor with vbFalse works the restriction. The
same result, all contractback=Yes Items are shown.

I defined in my Folder a new testview with the manuell filter in the
viewdefinition with contractback=No and there works it.

I don't have any clue what i could try :-/

Martin



Jeff Moore said:
Martin,

It looks to me like you are referring to "No" like a string variable, not
a bit. When working with bits 0=no and said:
Try one of the following and see what happens.

strRestrict2 = "[contractback ]= 0"

or

strRestrict2 = "[contractback ]= " & vbFalse


----- Martin wrote: -----

I have to user defined fields "guidparent" and "contractback" and I want to
filter the contact items for these fields. Both fields are defined on the
folder level. guidparent is a textfield and any separated filter works.
contractback is a yes/no field and any attempt to filter for the fieldstatus
"no" failed.

My restriction is
strRestrict2 = "[contractback ]= 'No'"
ctlViewContacts.Restriction = strRestrict

The result is amazing. Outlook shows all Elements which are contractback
=Yes. I couldn't manage it that outlook shows me the desired result.

How would I corectly connect the restriction filter? Does this work?

strRestrict = "[guidparent] = '" &
Item.UserProperties.Find("guid").Value &
"'" & " And ""[contractback ]= 'No'"

Any Help would be appreciated!

Martin
 

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