Re: Elegant way of handling combo box "Not in list" event?



Rico wrote:
Hello,

Is there any way to get rid of or replacing the error message that pops up
when you enter a combo box item that isn't in the list? I've tried using
the Not In List event, but there is still an Access error that is raised.
Any ideas?

Thanks!
Rick

Setting Response to acDataErrContinue or acDataErrAdded avoids the
default message. See NotInList Event in the help file.

For example,

Private Sub cbxJobNumber_NotInList(NewData As String, Response As
Integer)
MsgBox ("The Job Number you entered is not in the list. Please try
again.")
Response = acDataErrContinue
cbxJobNumber.Undo
End Sub

James A. Fortune
CDMAPoster@xxxxxxxxxxxxxxxx

Pittsburgh has more bridges than any other city in the world. --
http://www.thepittsburghchannel.com/news/9841603/detail.html

.



Relevant Pages

  • RE: Update Combo Box
    ... Response As Integer) ... Response = acDataErrContinue ... ElseIf intresult = vbYes Then ... 'Continue without displaying default error message ...
    (microsoft.public.access.formscoding)
  • RE: Update Combo Box
    ... Response As Integer) ... Response = acDataErrContinue ... ElseIf intresult = vbYes Then ... 'Continue without displaying default error message ...
    (microsoft.public.access.formscoding)
  • Re: Duplicate Entries in Ke/Unique Indexs
    ... Dim strmsg As String ... Response = acDataErrContinue ... 'Custom Error Message if error is due to missing Stock Invoice, ...
    (microsoft.public.access.modulesdaovba)
  • On Not In List
    ... The following code does not work in the not in list event. ... Response = acDataErrContinue ... It never gets to the next command, access will just repeat the msgbox ...
    (microsoft.public.access.formscoding)
  • Re: Tab Cycle Current Record still goes to next record
    ... add a new record via the not in list event? ... Response = acDataErrContinue ... The ProgramInfoPopup form has this code in its OnLoad Event: ...
    (microsoft.public.access.forms)