if statement

  • Thread starter Thread starter Joel Allen
  • Start date Start date
J

Joel Allen

Hello,

I have this and it doesn't quite work:

If InStr(1, Item.UserProperties("WindowRating") ,"20") > 0 Then
colFields("min20").CheckBox.Value = True
end if

I want colFields("min20").CheckBox.Value = True
If WindowRating has a 20 in it like this (20 or 20,120), but not if
WindowRating only = 120

Thanks for your help,
Joel
 
Then use Left() instead of Instr():

If Left(Item.UserProperties("WindowRating"), 2) = "20" Then
 
Thanks Sue, but sometimes the value is this:

"non-rated,20,120"

Then use Left() instead of Instr():

If Left(Item.UserProperties("WindowRating"), 2) = "20" Then
 
Well, the more detail you provide the better. We can't read minds. What else haven't you told us about possible values? Why not just add a second Instr() to check for "120"?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Thanks, that worked.

Well, the more detail you provide the better. We can't read minds. What else
haven't you told us about possible values? Why not just add a second Instr()
to check for "120"?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top