delphi - TCheckBox to filter dataset by a field -
i'm trying filter dataset 1 field when ticking checkbox, following code have put , thought correct doesn't appear working, brings 0 records.
procedure tfrmcustomers.cbclick(sender: tobject); if cbactive.checked = true dmod.cds begin disablecontrols; try filtered := false; filteroptions := [focaseinsensitive,fonopartialcompare]; filter := ('active true'); filtered := true; enablecontrols; end; end; end;
the name of field in dataset called 'active' , stores string of either 'true' or 'false'.
any appreciated.
thanks,
if field 'active' holds string should write:
filter := ('active = ''true''');
right filtering on boolean value true. also, why don't use boolean / bit field active field?
Comments
Post a Comment