Subject Re: [IBO] 4.2f ibotable master/detail insert and dbnavigator edit button
Author Daniel Rail
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 suggest
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. (