GetFilter

Method
Retrieves the filter set for a given field.

Category
Filters

 

Syntax
Function GetFilter(ByVal hTable As Long, ByVal FieldNo As Long) As String

hTable
The handle to the table.

FieldNo
The number of the field whose filter is to be retrieved.

 

Example

'Case "SetFilterGetFilter"

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

  Else

  logWr "GetFilter failed"

  End

  End If

  CF1.CloseTable hTable

 

Comments
GetFilter returns the filter expression set by SetFilter or SetRange for the field FieldNo.



© 2009 Microsoft Corporation. All rights reserved.