Consulting

Results 1 to 3 of 3

Thread: SQL Syntax help

  1. #1

    SQL Syntax help

    Howdy,

    In the code below, there are four choices for the user on a form. The country name gets passed through an SQL statement. How would I need to work the last option so that it retrieves all records that are not USA, CAN, or MEX?

    Thanks

    Jeff

    Private Sub cmdNext_Click()
    Me.Hide
    If frmCountryChoice.optUSA = True Then
    gstrSteps(0) = optUSA.Caption
    Call CreateImageUSA
    ElseIf frmCountryChoice.optCanada = True Then
    gstrSteps(0) = optCanada.Caption
    Call CreateImageNotUSA("CAN")
    ElseIf frmCountryChoice.optMexico = True Then
    gstrSteps(0) = optMexico.Caption
    Call CreateImageNotUSA("MEX")
    Else 'then it must be LATAM
    gstrSteps(0) = optLATAM.Caption
    Call CreateImageNotUSA("???")
    End If


    End Sub

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Private Sub cmdNext_Click()
    Me.Hide
    If frmCountryChoice.optUSA = True Then
    gstrSteps(0) = optUSA.Caption
    Call CreateImageUSA
    ElseIf frmCountryChoice.optCanada = True Then
    gstrSteps(0) = optCanada.Caption
    Call CreateImageNotUSA("CAN")
    ElseIf frmCountryChoice.optMexico = True Then
    gstrSteps(0) = optMexico.Caption
    Call CreateImageNotUSA("MEX")
    Else 'then it must be LATAM
    gstrSteps(0) = optLATAM.Caption
    Call CreateImageNotUSA("NOT In ('CAN', 'MEX', 'USA')")
    End If
    End Sub
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3

Posting Permissions

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