I am using combobox to populate values from a table, 'Suppliers'. I put this combobox in a form wherein the order details are filled up. This column 'Supplier' is a Foreign Key and set to NotNull in the order detail table. Selecting the first available entry on the combobox gives error 'SupplierID cant be Null' . Selecting the 2nd value is OK, first choosing 2nd and coming back to 1 is also OK. This error comes up when trying to update the database.
Even with the first value, the combobox is having a text. I would like to know why the error.
Then choise it to question, it shows now up as a discussion.
But giving an answer is very difficult. Is the only reply you get Supplier ID cant be Null, I doubt it because this text I've never seen.
If you have an error give at least the complete text from that.
Again, my mistake.
I am trying to design a Inventory program and the table designs are somewhat like Northwind database. Here the SupplierID is a colmn and not a literal meaning. The table Suppliers holds the details of the Suppliers, where the SupplierID is the primary key. In another table, SupplyOrders, I have SupplierID as FK.
When a new order is to be added, i present the SupplierID in a combobox. When loading the form, i populate the combobox from Suppliers table. It shows the values. At present, the supplier table has only 2 rows of data.
Now in the OderDetail form, when i choose the first available entry only, i cant update the database. Choosing the 2nd , i can update the db. Choosing the 2nd and coming back to the first also is OK.
My question why choosing the first available entry in combo gives error. ? Since there is no 'Default' value for the combobox, i cant set that also. Why cant I choose the first?