Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Multiple records found, only one is expected' error

Status
Not open for further replies.

shanzen

Programmer
Apr 1, 2001
9
GB
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;
 
Hai
You can try it with cursor. The trigger will fire for the top most row for a multiple row inserted. It is better to use cursor for this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top