Subject Re: (Ooops!) Possible Incorrect Logic in TIB_LookupCombo
Author Eric Handbury
I forgot about the REQUIRED setting in the ColumnAttributes property.
This fixed it up.

--- In IBObjects@y..., "Eric Handbury" <ehandbury@h...> wrote:
> Hello,
>
> (BCB6-SP2, IBO-4.2Hf, FB-1.0, Enh2.1.2)
>
> I have a LookupCombo, which when I hit 'DEL' to delete the entry
in
> the control, it sets the underlying field to NULL. I don't think
this
> is correct... I feel it should set the field to the value stored in
> the DefaultValues.
> What's happening with me is that I hit 'DEL' and it sets the
field
> value to NULL, then the 'FIELDXX is a required field' exception is
> being generated. So to circumvent this I am checking the field
value
> in the BeforePost to see if it is NULL, and if so, setting it to 0
> (my IB field attributes is INTEGER DEFAULT 0 NOT NULL). I shouldn't
> have to do this on every BeforePost that has a LookupCombo... IBO
> should really do it (since it knows what its default value is.)
>
> Unfortunately, I don't have Delphi so changing the underlying
code
> is difficult but the current logic for the assignment is below:
>
> procedure SysUpdateKeyLinksData (IBA_Dataset.IMP)
> ...
> if tmpCanModifyKeyLinkField then
> KeyDataset.FieldByName( KeyLinks.IndexValues[ ii ] ).Assign(
> FieldByName( KeyLinks.IndexNames[ ii ] ));
> ...