Subject | Re: [IBO] 4.2f ibotable master/detail insert and dbnavigator edit button |
---|---|
Author | Daniel Rail |
Post date | 2002-02-03T16:52:29Z |
Comments below.
that you use a Boolean variable to indicate this.
Example of usage:
procedure TButton.OnClick(Sender: TObject);
begin
InsertingRecord := True;
TIBOTable.Insert;
...
your code here
...
InsertingRecord := False;
end;
procedure TIBOTable.OnBeforeInsert(Dataset: TDataset);
begin
if not InsertingRecord then
Abort; {This will abort the Insert process}
end;
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. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)
>1)Since you're using a regular button to perform your insert, then I suggest
>i have disabled the insert button for the detail dbnavigator and
>give the user one special button with some code to insert new
>records.
>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 ?
that you use a Boolean variable to indicate this.
Example of usage:
procedure TButton.OnClick(Sender: TObject);
begin
InsertingRecord := True;
TIBOTable.Insert;
...
your code here
...
InsertingRecord := False;
end;
procedure TIBOTable.OnBeforeInsert(Dataset: TDataset);
begin
if not InsertingRecord then
Abort; {This will abort the Insert process}
end;
>2)I honestly have to say that this is odd. Because, I don't have this
>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.
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. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)