Subject Re: [IBO] Currency is Null ---- How to stop
Author Marco Menardi <mmenaz@lycosmail.com>
Lucas, the Default definition does not solve the problem of Micahel.
He is asking not to having a 0 when a record is inserted, but not to
have a null if the user clears the TIB_Edit linked with a currency
field. For this, the default is useless.
Micahel, try to use my IB_Currency instead of IB_Edit, it should
always post 0 instead of null, but I'm not sure ;)
let me know
Marco Menardi

--- In IBObjects@yahoogroups.com, Lucas Franzen <luc@r...> wrote:
>
> Micahel,
>
>
> > I have fields defined as
> >
> > CREATE DOMAIN T_CURRENCY AS NUMERIC(9,2) DEFAULT 0
> >
> > When these fields are displayed using TIB_Edit, if the user
> > selects the data in the field and hits "Delete", then the
> > value stored in the field of the DB is "NULL" instead of zero.
>
> Of course it is.
> If you don't enter a value it's NULL.
>
> >
> > Is there a way I can have IBO set the fields to zero? Or
> > do I need to have a on update/insert trigger that checks
> > every numeric field in the record to see if they are null
> > and replace with a zero?
>
> Either open the QueryEditor, prepare your query and enter "0" for that
> field in the fields-property.
>
> or
>
> If you want ALL your fields that have the domain T_CURRENCY to be
> defaulted to 0 then you have to do the following steps.
>
> 1. Set the property FieldEntryTypes-->fetDomain Names of your
> IB_Connection to TRUE.
> 2. Open the DefaultValues of the IB_Connection and enter:
> T_CURRENCY=0
>
> That's it.
>
>
> Have a nice christmas
>
> Luc.