Subject Re: A new try to explain better the topic - [IBO] TIBOQuery.Edit would must to call always AfterPost with Next call
Author Geoff Worboys
> I have a form with a master detail relation. I haven't autocommit.
> When I edit the detail I force the master to edit because the master
> afterpost event does the transaction commitretaining, if the user
> cancel the master I do a rollbackretainning. I have a problem, if I
> edit the master but no field in the master is updated, IBO don't do
> the master afterpost and I think that IBO would must to do.

I am surprised that AfterPost is not being called - but then I am not
that familiar with the TDataset based components.

However I do think Helen was correct in questioning the fact that you
are trying to do the commit/rollback in AfterPost/AfterCancel.

Rather than going to the trouble of forcing the master dataset into
edit mode - just so it can be posted and force a commit - supply
commit/rollback buttons to the transaction.

When I setup a form for the user I generally dont give then
post/cancel buttons attached to the dataset, I give them save/cancel
buttons attached to the transaction. It is much simpler and the
transaction will automatically post or cancel any datasets that have
outstanding changes.

Does this help?

Geoff Worboys
Telesis Computing