Subject Re: [IBO] Required Fields and Exception Handling
Author Helen Borrie
At 07:00 PM 7/08/2006, you wrote:
>I have a field in a query (IB_Query) which I set the column attributes
>to Required.
>I would like to handle the exception to provide a more friendly and
>informative message, and the option of looking in the help file.
>I have tried the onError and onPostError events, but the required
>exception happens before these events.
>OnValidateField is only useful if the field is edited - if no editing
>occurs - not called for this field.
>I can check in the before post event, as this occurs before the required
>exception. The problem with this is that if cancel is called at this
>point, all edits are lost.

Don't cancel it.

>Is there another way to abort the post at
>this point and still retail the edited detail ?

Use the BeforePost event to intervene and call SysUtils.Abort. That
simply places you back where you were before the call to Post.

>Is there a better way than the before post event to handle the required



>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>Yahoo! Groups Links