If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
NotInList How to eliminate System Generated Error
I am using the following code. Everything works EXCEPT after the message I put in the code, I get the system generated message: "The item you selected is not in the list - Please select...." How do I eliminate that message?? I have LimitToList set to YES, and this code is in the NotInList property. Option Compare Database Option Explicit Private Sub ContractorName_NotInList(NewData As String, Response As Integer) If MsgBox("Do you want to add '" _ & NewData & "' to the list of contractors?", _ vbOKCancel, "Add New Item") = vbOK Then ' Remove new data from combo box so control can be requeried ' after the Form1 form is closed DoCmd.RunCommand acCmdUndo ' Display form to collect data needed for the new record DoCmd.OpenForm "Form1", acNormal, , , acAdd, acDialog, NewData 'Continue without displaying default error message. Response = acDataErrAdded Else Response = acDataErrContinue End If End Sub Thanks for your assistance in advance, 10SNUT -- 10SNUTPosted from http://www.pcreview.co.uk/ newsgroup access |
#2
|
|||
|
|||
10SNUT 10SNUT.1rck5b@ wrote:
I am using the following code. Everything works EXCEPT after the message I put in the code, I get the system generated message: "The item you selected is not in the list - Please select...." How do I eliminate that message?? I have LimitToList set to YES, and this code is in the NotInList property. Option Compare Database Option Explicit Private Sub ContractorName_NotInList(NewData As String, Response As Integer) If MsgBox("Do you want to add '" _ & NewData & "' to the list of contractors?", _ vbOKCancel, "Add New Item") = vbOK Then ' Remove new data from combo box so control can be requeried ' after the Form1 form is closed *** JUST REMOVE THIS CODE *** *** DoCmd.RunCommand acCmdUndo ' Display form to collect data needed for the new record DoCmd.OpenForm "Form1", acNormal, , , acAdd, acDialog, NewData 'Continue without displaying default error message. Response = acDataErrAdded Else Response = acDataErrContinue End If End Sub Thanks for your assistance in advance, 10SNUT Hi 10SNUT, I answered it of the other thread. Thanks for posting your code and the problem. HTH -- RuralGuy Please reply to the newsgroup so all may benefit. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Eliminate error "The outlook file was not closed properly" | RicardoRG | General Discussion | 2 | May 2nd, 2005 01:51 PM |
MAPISP32.exe has generated error and will be closed by windows | jwkalaij | General Discussion | 1 | January 14th, 2005 10:46 AM |
Query too complex and system resources exceeded error | shannonh | General Discussion | 1 | October 1st, 2004 02:04 PM |
Visual Basic Error Messages in Office Apps | Paul Jordan | General Discussions | 2 | August 6th, 2004 03:49 PM |
1706 error for one user on a multiuser winxp system | jcg | Setup, Installing & Configuration | 2 | July 17th, 2004 03:52 PM |