C
cvegas
This code works fine for filtering my grid and returning the proper Customer
records. I would like to add Prospect to the criteria but am having trouble
with the syntax to accomplish this
Private Sub txtAccountName_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strFilter As String
Dim strFilterName
This code works fine and pulls the correct records if AccountType =
Customer. I would like to also pull records where AccountType = Prospects
and am having trouble with the sysntax.
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 ='Customer'"
I have tried
AND AccountType = 'Prospect'"
OR AccountType = 'Prospect'"
I could use help with the proper syntax to add the second criteria.
Thanks in advance.
records. I would like to add Prospect to the criteria but am having trouble
with the syntax to accomplish this
Private Sub txtAccountName_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strFilter As String
Dim strFilterName
This code works fine and pulls the correct records if AccountType =
Customer. I would like to also pull records where AccountType = Prospects
and am having trouble with the sysntax.
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 ='Customer'"
I have tried
AND AccountType = 'Prospect'"
OR AccountType = 'Prospect'"
I could use help with the proper syntax to add the second criteria.
Thanks in advance.