Link to home
Start Free TrialLog in
Avatar of WINN2012
WINN2012Flag for United States of America

asked on

Saving a sql record when combo box is empty.

I have a small issue tracker vb .net app I created that uses sql server.
I have 2 tables, issues and related issues, joined on issueID in a 1 to many relationship.

My form has several fields, 2 of them are combo boxes which are Opened By and Assigned To
i created a dataset called Contacts, I then plop it onto each of the combo boxes, at this point everything is as expected. Scrolling through the records, each of the combo boxes is displaying the correct person.

The problem occurs when I need to blank out one of the combo boxes, Assigned To in this case. I then click save and close the form, now if I go back to the form to that record it still has the original person, not blank as expected. If I pick someone else instead of emptying the field and save it, then it does get saved.

Hopefully that's enough information to get an idea what my issue is.

Thanks
MW
ASKER CERTIFIED SOLUTION
Avatar of jay813
jay813

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WINN2012

ASKER

Its the normal save when you add a dataset to a form. Its on my work pc so I can't paste it atm.
Yes I basically want to set the value to null in the DB, all I am doing is deleting the users name from the field.
I had thought about adding a N/A to the Contacts Table as you mentioned.

Thanks
MW