Help with SQL syntax please

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'"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top