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

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -