Solved

Turnoff Access's "Not in List" warning

Posted on 2003-11-30
10
421 Views
Last Modified: 2006-11-17
I have setup the event for NotInList to my own Msgbox, but how do i make Access's warning about the "Text you entered in not an item in the list" to go away.  I tried to put in warnings = false before my msgbox and then true after ... but that did nothing.
0
Comment
Question by:tljprincess
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 1

Expert Comment

by:udir
ID: 9848645
Hi tljprincess
try to set (in the comboBox Properties)
the 'Limit To List' To 'No'.
Udir
0
 
LVL 10

Expert Comment

by:jobrienct
ID: 9848688
post your code where you disabled warnings pls.

John
0
 
LVL 28

Accepted Solution

by:
TextReport earned 125 total points
ID: 9848714
The NotInList event has a parameter of Response and by setting this in the procedure access will either

Taken from the Access 2000 help file

Response = acDataErrDisplay '(Default) Displays the default message to the user. You can use this when you don't want to allow the user to add a new value to the combo box list.

Response = acDataErrContinue 'Doesn't display the default message to the user. You can use this when you want to display a custom message to the user. For example, the event procedure could display a custom dialog box asking if the user wanted to save the new entry. If the response is Yes, the event procedure would add the new entry to the list and set the Response argument to acDataErrAdded. If the response is No, the event procedure would set the Response argument to acDataErrContinue.

Response = acDataErrAdded  'Doesn't display a message to the user but enables you to add the entry to the combo box list in the NotInList event procedure. After the entry is added, Microsoft Access updates the list by requerying the combo box. Microsoft Access then rechecks the string against the combo box list, and saves the value in the NewData argument in the field the combo box is bound to. If the string is not in the list, then Microsoft Access displays an error message.

Cheers, Andrew
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Benjamin_Luk
ID: 9849060
Change following code a little, and paste it under your Combo Event : [On Not in List]

Dim ctl As Control
Set ctl = Me!Combo5 'Change the name here
        Response = acDataErrContinue
        ctl.Undo


it will do it for you

Regards

Ben
0
 
LVL 2

Expert Comment

by:dom_cath
ID: 9854995
Hi there,

The correct command to control the setwarnings is:

docmd.setwarnings False

....Your code that you want to ignore warnings from.

docmd.setwarnings true

and NOT docmd.setwarnings=false or =true

Hope this helps.

Dom
0
 
LVL 9

Expert Comment

by:ornicar
ID: 10075451
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10210098
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: TextReport {http:#9848714}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

stevbe
EE Cleanup Volunteer
0
 
LVL 2

Expert Comment

by:dom_cath
ID: 10212619
I think you should split them as my answer also works to halt the warnings.

Dom
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10212746
set warnings has no effect on "not in list" messages.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question