Subject | RE: [IBO] Data module question |
---|---|
Author | Christian Kaas |
Post date | 2001-06-21T13:34:48Z |
Just use that Datamodule in your form and write an event handler on the form which you manually assign to the Data Module Query's BeforeInsert Event:
procedure TForm1.BeforeInsertEvent(IB_Dataset: TIB_Dataset);
begin
end;
and in your OnformCreate:
begin
yourDataModule.YourIB_Query.OnBeforeInsert := BeforeInsertEvent;
end;
bst practice in OnDestroy of your Form:
begin
yourDataModule.YourIB_Query.OnBeforeInsert := nil;
end;
procedure TForm1.BeforeInsertEvent(IB_Dataset: TIB_Dataset);
begin
end;
and in your OnformCreate:
begin
yourDataModule.YourIB_Query.OnBeforeInsert := BeforeInsertEvent;
end;
bst practice in OnDestroy of your Form:
begin
yourDataModule.YourIB_Query.OnBeforeInsert := nil;
end;
> -----Original Message-----
> From: Francois Leemans [mailto:lee@...]
> Sent: Thursday, June 21, 2001 2:43 PM
> To: IBObjects
> Subject: [IBO] Data module question
>
>
>
> For simplicitys sake I use a datamodule where I keep my Querys
> and stuff.
> In this data module I have a TIB_Datasource and a TIB_Query
> I use those in a unit with a TIB_Grid.
> This works fine.
> Now when in the grid a new record is created, I want to intervien
> before the
> insert take place.
> Normally I would use the beforeInsert event of the TIB_Query.
> Since the TIB_Query is not in the unit but in the datamodule, I
> can not use
> the beforeinsert event.
> How do I work around this ?
>
> Lee
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>