Adding Item in combo box bound field

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.
 
R

Rick Brandt

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.
 
S

schneider

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.
 
L

Larry Daugherty

Response = acDataErrAdded should be in the NotInList event code in the YES
path...

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top