if rdball.checked=true then accept := (table1['class']='支出')    or   (table1['class']='收入');
 if rdbOut.checked=true then accept := table1['class']='支出';
  if rdbIn.checked=true then accept  := table1['class']='收入';
因为radiabutton是多选一的,所以没必要那样写

解决方案 »

  1.   

    我觉得你应该在各个radiobutton中写下相应的代码:如在rdball的onclick中
    if rdball.checked then 
     begin
        if table1.filtered then table1.filtered:=false;
        accept := (table1['class']='支出') or (table1['class']='收入')
        table1.filtered:=true;    
      end;
      

  2.   

    呵呵,
    table1.Filtered:=False;
    table1.Filtered:=True;
      

  3.   

    在各个RadioButton的OnClick事件中写:  
    table1.filtered:=false;
    table1.filtered:=true;
    才对.因为你不运行第一句,Table不会重新过虑的.
      

  4.   

    当天:
    在able1FilterRecord中
    accept := (table1['date']=date)
    当月:
    year,month,day:word;
    date1,date2:TdateTime;
    DecodeDate(date,year,month,day)
    Date1:=EncodeDate(year,month,1);
    date2:=EncodeDate(year,month,31);//当月的日数为30,28,29,31的就写 
              //30,28,29,31,这要自己判断
    accept := (table1['date']>=date1 and table1['date']<=Date2)
    当年:
    year,month,day:word;
    date1,date2:TdateTime;
    DecodeDate(date,year,month,day)
    Date1:=EncodeDate(year,01,1);
    date2:=EncodeDate(year,12,31);//月的日数为31
    accept := (table1['date']>=date1 and table1['date']<=Date2)