Subject Antw: Re: [IBO] 4.2f ibotable master/detail insert and dbnavigatoredit button
Author Uwe Cramer
thanks to daniel,

the sample for my 1 question may work, but i think that
the dbnavigator edit button should be disabled if the
connected dataset isempty or not?

for my second question i will test it


>>> drail@... 03.02.2002 17:52:29 >>>
Comments below.

>i have disabled the insert button for the detail dbnavigator and
>give the user one special button with some code to insert new
>but the edit button in dbnavigator acts also like the insert button
>when the detail is empty and it inserts a new record.
>how can i change this ?

Since you're using a regular button to perform your insert, then I
that you use a Boolean variable to indicate this.

Example of usage:

procedure TButton.OnClick(Sender: TObject);
InsertingRecord := True;
your code here
InsertingRecord := False;

procedure TIBOTable.OnBeforeInsert(Dataset: TDataset);
if not InsertingRecord then
Abort; {This will abort the Insert process}

>when i insert the FIRST record in the empty detail and post it, all
>data from the filled fields are lost
>all fields except the key and (reference field to the master table)
>are empty.
>when i edit this record, fill out the fields a second time, and save
>them, all is fine.
>when i then insert more detail records all filled fields are saved
>with the first post.

I honestly have to say that this is odd. Because, I don't have this
problem. Can you check in what sequence your code is executed, by
doing a
debug and using break points?

Daniel Rail
Senior System Engineer
ACCRA Group Inc. (
ACCRA Med Software Inc. (

------------------------ Yahoo! Groups Sponsor

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

Your use of Yahoo! Groups is subject to