Assigns a filter to a specified field.
Sub SetFilter(ByVal hTable As Long, ByVal FieldNo As Long, ByVal FilterStr As String)
The handle to the table.
The number of the field for which a filter will be set.
The filter expression for the field, consisting of alphanumeric characters and one or more of the following operators: < > ? & | =
'Sets the filter (from Parameter1 at "Currency"-field from "Customer"-table
'and gets the filter afterwards
CF1.OpenTable hTable, 18
logWr "No. of records before applying filter: " & Str$(CF1.RecCount(hTable))
tmpStr = frmCfrontTest.Text1(cf.FilterCurrency).Text
CF1.SetFilter hTable, 22, tmpStr
logWr "No. of records after applying filter: " & Str$(CF1.RecCount(hTable))
tmpVar = CF1.GetFilter(hTable, 22)
If VarType(tmpVar) = vbString And tmpStr = tmpVar Then
logWr "GetFilter OK"
logWr "GetFilter failed"
SetFilter assigns a filter to FieldNo. Any filter already assigned to FieldNo for this table handle is removed before the new filter is attached. If FilterStr is an empty string, no filter will be assigned to FieldNo, and any filter currently assigned will be removed.
For more information about filter syntax and relational operators, see the Application Designer’s Guide.