Solved

Turnoff Access's "Not in List" warning

Posted on 2003-11-30
10
417 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

Industry Leaders: 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!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

739 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