C
cvegas
This is the syntax I use to display data in my grid control when I load my
form. It work properly
SELECT tblAccounts.AccountNumber, tblAccounts.AccountName, tblAccounts.City,
tblAccounts.State, tblAccounts.PostalCode, tblAccounts.AccountType,
tblAccounts.PrimaryPhoneNumberFormatted,
tblAccounts.PrimaryFaxNumberFormatted, tblAccounts.PrimaryEmailAddress,
tblAccounts.URL1
FROM tblAccounts
WHERE (((tblAccounts.AccountType)<>'Prospect' And
(tblAccounts.AccountType)<>'Customer'))
ORDER BY tblAccounts.AccountName;
This is the syntax I use to filter my grid based on what is typed into
txtAccountName
It works properly except that on each keystorke it dispays records from
tblAccounts that have "Prospect" and "Customer" in the AccountType.
Private Sub txtAccountName_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strFilter As String
Dim strFilterName
strFilterName = Me.txtAccountName.Text
strFilter = "SELECT * FROM tblAccounts WHERE AccountName Like '" &
strFilterName & "%" & "'"
I know that it is selecting all records in tblAccounts because of the *
What I need help with is putting the SELECT statement together so that it
only pulls the records that meet the <>Prospect AND <>"Customer" criteria
'Remainder of code that filters the grid
Forms!frmVendorlist.grdVendorList.DBActive = False
Forms!frmVendorlist.grdVendorList.DBRecordSource = strFilter
Forms!frmVendorlist.grdVendorList.DBActive = True
End Sub
Thanks in advance for any help with putting this together.
form. It work properly
SELECT tblAccounts.AccountNumber, tblAccounts.AccountName, tblAccounts.City,
tblAccounts.State, tblAccounts.PostalCode, tblAccounts.AccountType,
tblAccounts.PrimaryPhoneNumberFormatted,
tblAccounts.PrimaryFaxNumberFormatted, tblAccounts.PrimaryEmailAddress,
tblAccounts.URL1
FROM tblAccounts
WHERE (((tblAccounts.AccountType)<>'Prospect' And
(tblAccounts.AccountType)<>'Customer'))
ORDER BY tblAccounts.AccountName;
This is the syntax I use to filter my grid based on what is typed into
txtAccountName
It works properly except that on each keystorke it dispays records from
tblAccounts that have "Prospect" and "Customer" in the AccountType.
Private Sub txtAccountName_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strFilter As String
Dim strFilterName
strFilterName = Me.txtAccountName.Text
strFilter = "SELECT * FROM tblAccounts WHERE AccountName Like '" &
strFilterName & "%" & "'"
I know that it is selecting all records in tblAccounts because of the *
What I need help with is putting the SELECT statement together so that it
only pulls the records that meet the <>Prospect AND <>"Customer" criteria
'Remainder of code that filters the grid
Forms!frmVendorlist.grdVendorList.DBActive = False
Forms!frmVendorlist.grdVendorList.DBRecordSource = strFilter
Forms!frmVendorlist.grdVendorList.DBActive = True
End Sub
Thanks in advance for any help with putting this together.