F
FlyingDragon via AccessMonster.com
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
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