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

Popular posts from this blog

javascript - How to diff two immutable objects -

javascript - React.js: onClick function from child to parent -

c# - How can I have the VS Debugger break in the correct location for exceptions thrown in Async methods in a Console App? -