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
 

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

Back
Top