Results 1 to 5 of 5

Thread: Help with an IF statement

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    137

    Help with an IF statement

    Hi, i need to do an IF statement, does it support AND and OR in the same statement?

    If Card1val = "A" And Card2val = "K" OR Card1val = "K" And Card2val = "A" Then

    bascially, both need to contain A and K, doesnt matter which contains it. just as long as one of them has A, and the other has K.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Help with an IF statement

    Code:
    If (Card1val = "A" And Card2val = "K") OR (Card1val = "K" And Card2val = "A") Then

  3. #3
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Help with an IF statement

    well... you can make it

    If Card1val = "A" And Card2val = "K" Then
    'code
    ElseIf Card1val = "K" And Card2val = "A" Then
    'code
    Else
    'code
    End If

    but i suggest jggtz's code is better...

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    137

    Re: Help with an IF statement

    ive gone for jggtz method. thanks both!

  5. #5
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Help with an IF statement

    Please use the thread tools and mark the post "Resolved".

    Thanks.
    Doctor Ed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width