jamie_pattison
Well-known member
- Joined
- Sep 9, 2008
- Messages
- 116
- Programming Experience
- Beginner
I have a data entry windows form containing some textboxes and a combo box.
The combo list items are generated by calling a stored proc on a SQL server. The SQL is similar to
Item in the above code is a bit type in sql so it returns only the items that are available by setting the value to true/false against the item value.
A user would load this form and enter their name in the textbox etc, select an item from the list i.e. pencil and save the form.
The issue i have is if the user selected an item (like a pencil) from the dropdown, saves the form and then pencil is then set to 0 (false) in the database table.
Next time the form loads it displays pencil as the text in the combo box (which is ok) but if another field is changed on the form the user cant save the form as the combo is highlighting for the user to select an item from the combo, when in should remain with pencil. If they select ruler then the form is saved but this erases the original value which i want to keep.
How could i work around this by allowing pencil to be disabled at the database but still available so that the user could save the form with the original value but not selectable in the combobox any further?
Thanks
The combo list items are generated by calling a stored proc on a SQL server. The SQL is similar to
VB.NET:
Select * from table where [B]Item[/B]=1
Item in the above code is a bit type in sql so it returns only the items that are available by setting the value to true/false against the item value.
A user would load this form and enter their name in the textbox etc, select an item from the list i.e. pencil and save the form.
The issue i have is if the user selected an item (like a pencil) from the dropdown, saves the form and then pencil is then set to 0 (false) in the database table.
Next time the form loads it displays pencil as the text in the combo box (which is ok) but if another field is changed on the form the user cant save the form as the combo is highlighting for the user to select an item from the combo, when in should remain with pencil. If they select ruler then the form is saved but this erases the original value which i want to keep.
How could i work around this by allowing pencil to be disabled at the database but still available so that the user could save the form with the original value but not selectable in the combobox any further?
Thanks