Restriction Method 
Author Message
 Restriction Method

I am using the Restriction Method to obtain all the Contacts with the same
Last name and it is working perfect.  The issue is that I need to also have
all the contacts that the last name start with the string.  For example
retrieve all the contacts that have the last name Smith or Smithxxxxx.

The code that I am using is:

Set MyContas = MyItems.Restrict("[Last Name] ="&LastN)

What I should use if I want to retrieve all  the contacts with the same last
name and lives in NJ?

Thanks for your help.

Pat Hirsch



Sat, 16 Apr 2005 22:55:51 GMT  
 Restriction Method
It takes a more complex search string using >= instead of = and adding a <
expression. So what you're doing is asking for names >= "Smith" and <
"Smith{"

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm


Quote:
> I am using the Restriction Method to obtain all the Contacts with the same
> Last name and it is working perfect.  The issue is that I need to also
have
> all the contacts that the last name start with the string.  For example
> retrieve all the contacts that have the last name Smith or Smithxxxxx.

> The code that I am using is:

> Set MyContas = MyItems.Restrict("[Last Name] ="&LastN)

> What I should use if I want to retrieve all  the contacts with the same
last
> name and lives in NJ?

> Thanks for your help.

> Pat Hirsch



Sat, 16 Apr 2005 23:15:28 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PictureBox "Line" method restrictions

2. Restrictions in Expression Builder

3. (Q) Field Size restrictions in Crosstab query

4. HOWTO: Restriction [DueDate] = 'Jan 1, 4501'

5. Problem searching Outlook contacts w/new security restrictions

6. restriction on combox and form

7. Folder Restriction

8. Bypass Field Name Restriction for MailItem.UserProperties

9. Period Restriction

10. Restriction on an infinite appointment

11. Public Folder home page with Outlook View Control and Restriction problem

12. attachment restriction-urgent

 

 
Powered by phpBB® Forum Software