disable default message (NotInList)
- From: "FlyingDragon via AccessMonster.com" <u50654@uwe>
- Date: Fri, 17 Apr 2009 08:55:51 GMT
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
.
- Follow-Ups:
- Re: disable default message (NotInList)
- From: Benjamins via AccessMonster.com
- Re: disable default message (NotInList)
- Prev by Date: Re: Loop TypeOf Is Textbox, but can I exclude some text boxes?
- Next by Date: Re: disable default message (NotInList)
- Previous by thread: Requering and Forms
- Next by thread: Re: disable default message (NotInList)
- Index(es):
Relevant Pages
|