Movement to another record after ApplyUpdates

Shane

Member
Hi,

I have just started using the DAO component set and cannot work out why the when I apply the updates, the query seems to refresh and move to a different record. If I do not execute the ApplyUpdates shown below, the the post works, and there is no movement in the data aware grid that I am using.

dmItemMaint.TestItemQry.Session.ApplyUpdates([dmItemMaint.TestItemQry], True);

Is there anything I am missing, or doing incorectly?

Thanks in advance

Shane
 
Hi,

The code is shown below. It is just behind a button.

dmItemMaint.TestItemQRY.DisableControls;

try
with dmItemMaint.TestItemQRY do
begin
Edit;
FieldByname('Item_Archived').AsDateTime := now;
Post;
end;

dmItemMaint.TestItemQry.Session.ApplyUpdates([dmItemMaint.TestItemQry], True);
finally
dmItemMaint.TestItemQRY.EnableControls;
end;

Thanks

Shane
 
Back
Top