We help IT Professionals succeed at work.

on not in list property

Rogerianus
Rogerianus asked
on
Hello,

I use the 'on not in list' combobox property to run some VBA code for opening a form where I can add new entries (codes and descriptions).
After showing a msgbox ('do you want to create a new entry?'), there is always a standard Access information message showing up 'The text you entered is not an item on the list'.
How can I avoid this message?
I already tried setwarnings false and on error goto 0.

Does anyone know?
Comment
Watch Question

You must set the LimitTolist Property to False in order to avoid this message.

Bye.
Commented:
You need to set the Response parameter before opening the form:

Response = acDataErrContinue
DoCmd.OpenForm "form1"

Nic;o)

Commented:
marcoszorrilla,

Setting "Limit to list" to "No" will suppress the "OnNotinlist" event....

Nic;o)
Frédéric MétrauxFreelance Project Development Manager

Commented:
How do you add the new entries?

Once you have added them to the source table of the combobox, you just refresh your combo:

...
your code
...
Me.ComboBox.Requery
Setting "Limit to list" to "No" will suppress the "OnNotinlist" event....

I have just made the test and it is exactly this way.  
Nic;o)  you are right.

Bye.

Author

Commented:
That's it, Nico!!
Every day I'm learning something new...

Thank you for your cooperation, have a nice weekend!

Roger.

Commented:
Nice weekend too ;-)
And success with the application !

Nic;o)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.