Small company logo:
   History
 
Advertising banner:
 
 Statement.Filter
Home • Help • Customization Tools • FCAS • Language Reference • Statement.Filter
 
Purpose
Requeries a record set with an SQL WHERE clause.
The Filter method is a fast, effective way of narrowing the records contained in a record set. Filter can be used on any statement cursor generated with an SQL statement provided that it does not have an SQL WHERE clause.
Filter is the preferred method for searching records in bound table applications.
Syntax
DBStatement.Filter (WHEREClause)


WHEREClause
The WHERE clause.
The Filter command appends this clause to the original SQL statement and requeries the database. After filtering a query, the record pointer points to the first record in the record set.
Calling the Filter method with a WHEREClause of "" removes the current Filter WHERE clause and returns the complete unfiltered record set.
Compliance:
Core level
Example
The following code example filters the Customers table in the data environment by customer name with a text string read off the form.
Sub Click()
        Dim filterstr As String
        filterstr = "MyCustName Like "' & txtSearchText.Text & "%"'
        Customers.Filter(filterstr)
End Sub