Here is my code:
*************
Private Sub VerifyAddress_Click()
Dim strSQL As String
If Forms!MAIN!Country = "USA" Then
strSQL = "SELECT ZIPCODEWORLDBASIC.state FROM ZIPCODEWORLDBASIC;"
ElseIf Forms!MAIN!Country = "CANADA" Then
strSQL = "SELECT * FROM IP;"
Else
MsgBox "Please Input the Country first."
Exit Sub
End If
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub
*************
The error message is "A RunSQL action requires an argument consisting of an SQL statement."
I have no clue about since everything seems fine. Thanks for your help.
*************
Private Sub VerifyAddress_Click()
Dim strSQL As String
If Forms!MAIN!Country = "USA" Then
strSQL = "SELECT ZIPCODEWORLDBASIC.state FROM ZIPCODEWORLDBASIC;"
ElseIf Forms!MAIN!Country = "CANADA" Then
strSQL = "SELECT * FROM IP;"
Else
MsgBox "Please Input the Country first."
Exit Sub
End If
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub
*************
The error message is "A RunSQL action requires an argument consisting of an SQL statement."
I have no clue about since everything seems fine. Thanks for your help.