Link to home
Start Free TrialLog in
Avatar of Rogerianus
Rogerianus

asked on

on not in list property

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?
Avatar of marcoszorrilla
marcoszorrilla

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

Bye.
ASKER CERTIFIED SOLUTION
Avatar of nico5038
nico5038
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
marcoszorrilla,

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

Nic;o)
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.
Avatar of Rogerianus

ASKER

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

Thank you for your cooperation, have a nice weekend!

Roger.
Nice weekend too ;-)
And success with the application !

Nic;o)