Hi,

I have a form with comboboxes, if the user doesnt select a value in the box I want a null to be sent to the database.

The insert works fine, i look at the record in the db and see the null.

The update doesnt work. gives me a n "Update statement conflicted with foreign key constaint....."

Public Sub Update()
TableAdapterCreate().Update(ID1, ID2, CType(cbox1.SelectedValue, Integer), CType(cbox2.SelectedValue, Integer), CType(cbox3.SelectedValue, Integer), CType(cbox4.SelectedValue, Integer), CType(cbox5.SelectedValue, Integer), CType(PostAssign.SOB.SelectedValue, Integer), CType(cbox6.SelectedValue, Integer), chkOther.Checked, Notes.Text)
End Sub

as I step through the selected value of the cbox 5 is shown as nothing (which it should be because the user didnt select a value for this combobox).

I assume this needs to be a null instead of nothing to get written to the database. the combox boxes need to match a primary key in another table so sending a 0 would also result in the forieign key error since the related table does not have a 0 ID field.

Thank you for your time and help