Click to See Complete Forum and Search --> : Trouble with NULLS,foreign keys, combos. Any great guru can help me?


Jaime Herrero
May 25th, 1999, 08:47 AM
The trouble is the following:

I have a SQLServer table. One of the fields corresponds with a foreign key value. But it may
be a null value.I mean, it may be a null value, but if it is not, it may correspond with one of the values of the foreign key
I have a DataCombo bound to this field. If I donīt edit the field, nothing happens when I update. A null value is correctly stored.
But if the user edits the value and decides he
wants to cancel edit (Backspace, or blanks " ")
when I update SQLSErver says "" or " " is not a
correct foreign key!!!
I tried, before updating the value (WillMove event), to set a NULL
value if the value is a blank. But sometimes i donīt have the control of every update - i have
Grids and other bound objects-
Otherwise, i cannot store a NULL value in a combobox.
Is there any way to do this, any option in Database design that doesnīt make me control it
using Database triggers?

Thanks in advance
JaIme

John Watson
May 25th, 1999, 04:12 PM
Jaime:

Thanks for your help on the VB6 data report question--it worked!

John