How to apply a filter to a DbListBox control.

  • KM724291
  • 08-May-2009
  • 08-May-2009

Summary

A wizard was created to filter on departments in the amEmplDept table. When the filter is applied the intended results are not displayed as anticipated.

Question

When configuring the 'Filter' parameter in a DbListBox control the expected results are not displayed. An example of the DbListBox is below.

  { DBListbox DBLstDeptFilter
    ColName = "Name|FirstName|IDNo"
    Filter = "PortfolioItem.User.bDepartment=Yes"
    Table = "amEmplDept"
  }

Answer

The 'Filter' applied to the DbListbox control is based on the field amEmplDept.bDepartment. The bDepartment field is boolean datatype having one of two values, true and false. True is represented as non-zero (1), false as zero (0). In this example, 'department = yes' is reflected as bDepartment=1. The filter should reflect the following change;
 
Filter = "PortfolioItem.User.bDepartment=1"