Hi,
whenever i ran this code, which actually triggers when the checkbox in a CheckListBox component is checked. I want to locate in the table the corresponding record and update it. But it keep giving me an error that 'Multiple records found, only one is expected'.
Please aid. Thank you for your kind attention.
var
i_rec : integer;
begin
ToDo_Lists.First;
for i_rec := 0 to CheckListBox_ListAll.ItemIndex do
ToDo_Lists.Next;
ToDo_Lists.Edit;
if CheckListBox_ListAll.State[CheckListBox_ListAll.ItemIndex] = cbChecked then
ToDo_Lists.FieldByName('COMPLETED').value := True
else
ToDo_Lists.FieldByName('COMPLETED').value := False;
ToDo_Lists.Post;
ToDo_Lists.Active := False;
ToDo_Lists.Active := True;
whenever i ran this code, which actually triggers when the checkbox in a CheckListBox component is checked. I want to locate in the table the corresponding record and update it. But it keep giving me an error that 'Multiple records found, only one is expected'.
Please aid. Thank you for your kind attention.
var
i_rec : integer;
begin
ToDo_Lists.First;
for i_rec := 0 to CheckListBox_ListAll.ItemIndex do
ToDo_Lists.Next;
ToDo_Lists.Edit;
if CheckListBox_ListAll.State[CheckListBox_ListAll.ItemIndex] = cbChecked then
ToDo_Lists.FieldByName('COMPLETED').value := True
else
ToDo_Lists.FieldByName('COMPLETED').value := False;
ToDo_Lists.Post;
ToDo_Lists.Active := False;
ToDo_Lists.Active := True;