Subject Re: [IBO] Modify an operation of the IB_UPDATEBAR
Author H.Klomann
Hi José,

> If I wan't avoid insert duplicate records if the user go to the '+'
> button of the IB_UpdateBar1, how I have to proceed to avoid for
> example the duplicate primary key message?

Proceed like this :

procedure TForm1.IB_Query1BeforePost(IB_Dataset: TIB_Dataset);
begin
if IB_Dataset.State=dssInsert then begin
// check your keys here, call Sysutils.Abort here if necessary
end;
end;


Harald


pepmallorca schrieb:

>
> Hallo:
>
> Thank you Harald,
>
> the IB_UpdateBar1.FocusedButton with ubDelete to avoid delete in some
> situations works ok !!!
>
> Another similar question:
>
> If I wan't avoid insert duplicate records if the user go to the '+'
> button of the IB_UpdateBar1, how I have to proceed to avoid for
> example the duplicate primary key message?
>
> I know exists the ubEdit, ubInsert, ubPost, but when I go to the '+'
> button, the ubInsert knows the old value (a blank record)... and it's
> no necessary the user go to the post button (for example if he goes
> to the next record but the cursor)
>
> The same case occurs when the user modify a record in the IB_Grid.
>
> Someone know how can I solve it?
>
> Thank you,
>
> José,
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/