[SOLVED] dbf and deleting records in a loop lazarus / 16-Databases ---------------------------------------------------------------------- timcs · 2013-01-03 21:47 Below is my code where I am trying to delete records from a dbf where the date in each record is not today please can some point out where I am going wrong as when I run this, it only appears to be deleting some of the records and each time I click the button that runs this, it does some more BUT even deletes todays record! Code: [Select]if dbf1.active = true then       begin          // dbf1.Filtered:=true;            dbf1.IndexName:='';            prev := 1;            dbf1.Filtered:=true;            dbf1.DisableControls;            if dbf1.ExactRecordCount>0 then            begin                dbf1.Filtered:=false;                dbf1.Active:=false;                dbf1.Active:=true;                dbf1.First;                while not dbf1.EOF do                begin                   if DateOf(dbf1.FieldByName('dateon').AsDateTime)