Updating a record
Posted: Wed 19 Nov 2008 18:53
I'm have a table with one field and I'm trying
to edit it. Multiple records can have the same
value in this field (the field is named "Name").
Am using this code:
with DM.myType do
begin
Edit;
fieldByName('Name').AsString:=edType.Text;
// Post;
UpDateRecord;
ApplyUpdates;
edType.Text:='';
end;
As long as I edit a record which is the only record
with that "Name" value it works. If I try to edit
a record which is one of several with the same
"Name" value, it fails with this exception error message
"Update failed. Found 3 records."
As you can see I have tried Post and UpdateRecord
with the same result. Can anyone help?
TIA,
Bob
to edit it. Multiple records can have the same
value in this field (the field is named "Name").
Am using this code:
with DM.myType do
begin
Edit;
fieldByName('Name').AsString:=edType.Text;
// Post;
UpDateRecord;
ApplyUpdates;
edType.Text:='';
end;
As long as I edit a record which is the only record
with that "Name" value it works. If I try to edit
a record which is one of several with the same
"Name" value, it fails with this exception error message
"Update failed. Found 3 records."
As you can see I have tried Post and UpdateRecord
with the same result. Can anyone help?
TIA,
Bob