Subject Re: [IBO] Data module question
Author Daniel Rail
At 06/21/2001 09:43 AM, you wrote:

>For simplicity's sake I use a datamodule where I keep my Query's 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 ?

What is stopping you from using TIB_Query's BeforeInsert? I do make
references to forms within datamodules. Just make sure that you check if
the form is created before attempting to reference it.

Example of code:
if Assigned(Form1) then
begin
{code that references Form1 components}
end;

Hope this helps.


Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)