
ComboBox - Style 2 - Dropdown List
On Fri, 21 Mar 1997 19:57:34 -0800, "Carlos Shoji"
Quote:
>Please, if someone could help me with this problem, I would appreciate very
>much.
>I have many Combo box (Style 2-Dropdown list) in my project, but some of
>them,
>it is not a required field, therefore the data in the table could have ""
>null or empty.
>but if I try to retrieve these fields, I get a message in the combo box
>text:
>"text property is read only", if I use Style 0 - Combo box default I can't
>lock the
>text field to just a predetermined options, i.e. the user would have the
>option to
>type in the text box, what I don't want him to do it.
>Any Suggestion, would be appreciated.
>Thanks,
There are various ways to do this, but the easiest is to check the
ListIndex of the combo box to see if an entry has been selected.
For example:
If cmbCountry.ListIndex <> -1 Then
recCountry.Fields(0).Value = cmbCountry.Text
End If
If the user had typed in any old {*filter*}into the combo box, then the
ListIndex property will have a value of -1.
Hope this helps,
Karl