disable default message (NotInList)

Tech-Archive recommends: Fix windows errors by optimizing your registry



hi all
i get the following code to add items in my combobox
it works fine
my problem is the default access message still appear if i click NO
Any help plz?


Private Sub DesID_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
Dim rst As DAO.Recordset
Dim db As DAO.Database

strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"

If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "desid") Then

Response = acDataErrDisplay

Else

Set db = CurrentDb()
Set rst = db.OpenRecordset("CrimesDes")

rst.AddNew
rst("CrimeDes") = NewData
rst.Update
Response = acDataErrAdded
rst.Close

End If

--
Message posted via http://www.accessmonster.com

.



Relevant Pages

  • Re: Requerying ComboBox in NotInList event
    ... Response As Integer) ... Dim rst As Recordset ... Set rst = CurrentDb.OpenRecordset ... Dim lngBlankFound As Long ...
    (comp.databases.ms-access)
  • Re: Requerying ComboBox in NotInList event
    ... Any attempt to requery the combobox gives me an error that the field ... Response As Integer) ... Dim rst As Recordset ... Set rst = CurrentDb.OpenRecordset ...
    (comp.databases.ms-access)
  • Re: Dbl-Click to add Choice to Combo Box
    ... > Thanks Steve! ... > Dim strsql As String, ... I would move "Response = acDataErrAdded" to be the next line after ... Set rst = db.OpenRecordset ...
    (microsoft.public.access.forms)
  • RE: Help With "NotInList"
    ... account number, it lets me add it but the rest of the fields fill on the form ... Dim rs As DAO.Recordset ... Response As Integer) ... Set rst = Me.RecordsetClone ...
    (microsoft.public.access.formscoding)
  • Re: Code Stops Due to No Values In Query
    ... Dim PoseidonHotelProgram As Database ... Title = "DEPARTURES PENDING" ' Define title. ... Response = MsgBox ... Set Myset2 = db1.OpenRecordset("RESPEL ALL CHARGES") ...
    (microsoft.public.access.modulesdaovba)