Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Restriction (http://www.outlookbanter.com/outlook-vba/49011-restriction.html)

Joel Allen May 24th 07 07:04 PM

Restriction
 
Hello,

I am using a restriction in my Task form code like this:

oOVCControl.Restriction = "[Manager's Name]='Bill Smith'"

Is it possible to set 2 parameters to the restriction like this?:

oOVCControl.Restriction = "[Manager's Name]='Bill Smith'" & "[Company]='ABC
Metal'"

Thanks,
Joel



Sue Mosher [MVP-Outlook] May 24th 07 09:16 PM

Restriction
 
If you coded the restrict string separately, I suspect you'd see the problem in an instant:

strFind = "[Manager's Name]='Bill Smith'" & "[Company]='ABC Metal'"
MsgBox strFind

Multiple search expressions need to be joined with the usual operators " AND " or " OR ".

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Joel Allen" wrote in message ...
Hello,

I am using a restriction in my Task form code like this:

oOVCControl.Restriction = "[Manager's Name]='Bill Smith'"

Is it possible to set 2 parameters to the restriction like this?:

oOVCControl.Restriction = "[Manager's Name]='Bill Smith'" & "[Company]='ABC
Metal'"

Thanks,
Joel




All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com