Subject Re: [IBO] tib_lookupcombo and dataset containing null values
Author Mario Zimmermann
Hurray, I'm not alone! :-))

I see another disadvantage:

I have written a billing application where you can assign discounts
for the customer: 5%, 7%, ...
or even <none>.

When the application creates the invoice, the assigned discount is
chosen from the lookup table. If the lookup field for the customer is
NULL, no discount is computed.

Because all my lookup tables are fully customizable by the user, I
cannot create fixed entries like

ID VALUE DESCRIPTION
0 0.0 <none>

and check if the assigned ID is 0 to avoid computing a discount. The
user could have changed this entry.

Mario


--- In IBObjects@y..., Gabriel Juncu <gjuncu@c...> wrote:
> Hi List!
>
> Mario, I agree with your suggestion, I also was faced with customers
that did
> not know how to delete the lookup contents. More than that, I had
some
> situations where I must be sure that the operator intended to post
the record
> with the field empty, so I have to force him to choose something in
lookup
> combo, even if he chooses <none>. If the lookup combo is empty (as
it is when
> inserting a new record), the "Post" button is inactive. The only
solution
> that came to my mind was to insert a "nondeletable" record in lookup
table
> with ID = 0 (pk) and with text "<none>" and in my program not to
test for
> null values but for 0 values. The drawback is that when I create a
new
> database, I must create all these nondeletable records.
>
> Regards,
> Gabriel
>
> ------------------------------------------------
>
> Monday, August 13, 2001 11:45:32 AM, Mario Zimmermann wrote:
>
> > If a lookup key should be NOT NULL, then I don't understand why a
> > TIB_LookupCombo allows to press <DEL> for retrieving a NULL value.
> > Since this not Windows standard to work with a combo box, I don't
find
> > it user friendly. So I am getting asked by my customers how to
remove
> > a previously chosen selection from a lookup combo.
>
> > Ok, it seems that I am the only one with this suggestion...
>
> > Thanks for all replies.
> > Mario
>
>
> > --- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
>
> >> LookupID Description
> >>
> >> 0 '<None>'
> >> 1 'Cheese and chocolate'
> >> 2 'Escargots'
> >> 3 'Jalapeno and vanilla'
> >>
> >> For lookup keys you should define a default and/or NOT
> > NULL, just to ensure that a new row never gets stored with a NULL
> > there.