Not In list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box on my form, I want the user to be able to enter a code
that isn't in the combo box, I don't want that code to be entered into the
combo box but I do want that code entered into the special table I've set up.
Using the not in list can I test for that code and not have the error
message come up about not being in the list? The codes I wish the user to be
able to enter would be 999901 or 999902. Hopefully this isn't to confusing.
Thanks for any help.
 
Since you know before hand the only 2 possibly offending entries, 999901 and
999902, why dont you just add those to the table feeding the combo box? And,
since you dont wish the combobox to display those values, set the combobox
rowsource so that it suppresses the display of those entries. eg.
cbo1.RowSource = "SELECT Field1 FROM Table1 WHERE Field1 Not Like 99990[12]"

Alternatively, in the NotInList Event procedure, do what you want with the
user's entry, then, set the Response argument to acDataErrAdded
 
Back
Top