Adding Item in combo box bound field

  • Thread starter Thread starter schneider
  • Start date Start date
S

schneider

I have a combo box that lists products from tblProducts. If the user types
in an item not in the list, the cboProduct.Not in list event is launched,
with the prompt asking the user if they want to add the item.

If yes, I run an insert query to add the item to the database, then do a
cbo.Requery. At that point, I can see the new item in the cbo box list.
However, I still get an error saying

"The text you entered isn't an item in the list."

But it IS in the list, I have added it, and I have requeried the combo box.
Why do I keep getting this error and what do I do to get rid of it. I have
searched the newsgroups and all the answers say to requery the combo box,
which I've already done. Thanks for any help you can give me.
 
schneider said:
I have a combo box that lists products from tblProducts. If the user types
in an item not in the list, the cboProduct.Not in list event is launched,
with the prompt asking the user if they want to add the item.

If yes, I run an insert query to add the item to the database, then do a
cbo.Requery. At that point, I can see the new item in the cbo box list.
However, I still get an error saying

"The text you entered isn't an item in the list."

But it IS in the list, I have added it, and I have requeried the combo box.
Why do I keep getting this error and what do I do to get rid of it. I have
searched the newsgroups and all the answers say to requery the combo box,
which I've already done. Thanks for any help you can give me.

Check to make sure that AutoCorrect is turned off for the control. In some cases
AutoCorrect will make a change to your selection (to something that is not in the
list) that is subtle enough to not be obvious to the user.
 
That didn't make a difference. I'm still getting the error. When I get the
error, if I manually select it in the combo box, then it's fine.
 
Response = acDataErrAdded should be in the NotInList event code in the YES
path...

hth
 
Back
Top