Subject Re: [IBO] Master Detail question
There is a way to differentiate between an explicit post and the postretaining.
There is a property called IsRetaining at the dataset level.
That ought to do it for you.

Let me know if there is any more problems on this. Be sure to make your triggers on the master aware of the initial insert
and then the subsequent update.

Jason Wharton

Hi there,

I have a form with a master-detail setup, but I'm a little confused
about something.

After entering the master data and the focus is now on the detail grid
the master dataset is still in insert mode. (As expected)

When the first detail record is posted (by user simply tabbing to next
detail line to enter second detail record) the master's BeforePost
event fires, but does not fire again until the master dataset is
properly posted (by user clicking UpdateBar tick, say).

To my understanding this is done to ensure the master can be posted
prior to posting the first detail record. After this, the master
remains in insert mode, and only fires the master BeforePost event
when the master dataset is properly posted.

I have code in my Master.BeforePost event which I only want to fire
when the user explicitly posts the master, but it is always being
called when the user has entered the first detail record. (As well as
when they do an explicit post)

My question is:
Does the master actually do a quick post, but then places itself back
into insert mode? And if so, is there a way to differentiate between
an explicit post and this type of post where the dataset returns back
to insert mode?

I hope this made some sense!

IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________ - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links