Results 1 to 5 of 5

Thread: Is there such thing as 'Is not' or is different to ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2009
    Posts
    876

    Is there such thing as 'Is not' or is different to ?

    Hi guys, Is there such thing as Is not?

    I tried it but i got type mismatch... I thought this would work ...





    If Combo3.Text Is Not "All Databases" And Combo1.Text = "All Agents" Then



    Set rs = db.OpenRecordset("SELECT * FROM `Leads` WHERE `CurrentStatus` = " & "'" & Combo2.Text & "' AND `Calling From` = " & "'" & Combo3.Text & "'")




    End If



    Thanks!

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Is there such thing as 'Is not' or is different to ?

    Different from? You mean like not equal to?
    Code:
    If A <> B Then
    ___________________________________________________________________
    Same as
    Different from
    Similar to

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Is there such thing as 'Is not' or is different to ?

    You could also use
    Code:
    If Not A=B Then

  4. #4
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: Is there such thing as 'Is not' or is different to ?

    You can try the following way also . it is really much better.
    Code:
    If  not (Combo3.text ="All Databases") then  
      if (combo1.text="All agents") then
        Set rs = db.OpenRecordset("SELECT * FROM `Leads` WHERE `CurrentStatus` = " & "'" & Combo2.Text & "' AND `Calling From` = " & "'" & Combo3.Text & "'")
      End if
    End if

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Is there such thing as 'Is not' or is different to ?

    Code:
    If Not Combo3.Text = "All Databases" And Combo1.Text = "All Agents" Then
      Set rs = db.OpenRecordset("SELECT * FROM `Leads` WHERE `CurrentStatus` = " & "'" & Combo2.Text & "' AND `Calling From` = " & "'" & Combo3.Text & "'")
    End If


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

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