Help with SQL syntax please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please advise if you see why this failing.

Thanks in advance.

Private Sub txtAccountName_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strFilter As String
Dim strFilterName
strFilterName = Me.txtAccountName.Text

strFilter = "SELECT tblAccounts.AccountNumber, " & _
"tblAccounts.AccountName , tblAccounts.Address1, tblAccounts.Address2, " & _
"tblAccounts.City, tblAccounts.State, tblAccounts.PostalCode,
tblAccounts.AccountType" & _
"FROM tblAccounts " & _
"WHERE AccountName Like '" & _
strFilterName & "%" & "' AND AccountType ='Prospect' " & _
"AND AccountType ='Customer'"
 
Back
Top