Subject AfterInsert - Buffer Problem ?
Author Frank
I have a query 'OfferDetails' with a MasterSource 'OfferHeader'
where the BeforeInsert Event looks like this:

iqOfferDetails.Last;
if iqOfferDetails.FieldByName('AUTO_ID').AsInteger >= 1 then
iOfferPos := iqOfferDetails.FieldByName('AUTO_ID').AsInteger + 1
else
iOfferPos := 1;

and the AfterInsert Event:

iqOfferDetails.FieldByName('AUTO_ID').AsInteger := iOfferPos;

then the Post Method is called manualy by the UpdateBar-PostButton.

Increasing the Details Positions this way works fine only
up to exactly the second insert -

then the iqOfferDetails.Last Method don't point to the latest entered
record - instead to the previous one !

For me it looks like either the post is not done or the data
is not correctly re-read or similar.

I also tried to insert an iqOfferDetails.InvalidateRows;
before the iqOfferDetails.Last; command but it does not
help ...

Any ideas on where I am wrong ???