PDA

View Full Version : [SOLVED] SQL Syntax help



jmenche
09-11-2014, 12:52 PM
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

Bob Phillips
09-11-2014, 01:38 PM
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

jmenche
09-11-2014, 02:30 PM
Thanks!