Combo Box (Style = Dropdown list)
Posted on 2001-06-08
I'm trying to save the contents of a combo box (Style = Dropdown list) to a table through ADO, but I receive the message: "Field tbl_Action.DAuthor cannot be a zero-length string" if the user doesn't select an item from the combo box before attempting to save the record.
In other words, if the user clicks SAVE and the combo box doesn't have an item selected, the above message appears.
Here's what I need help with:
I need to allow the user to SKIP this combo box if they want to. In other words, if they don't intend to select an item from the combo list box, how do I avoid the error message above if (IsNull)?
Next, if the user selects an item from the combo box, I need to save that value to the table field.
Finally, how do I clear the choice the user may have selected from the combo box if he/she wants to remove the item before saving the record. You can't simply place the cursor in the box and hit the ESC key.