Private Sub cbo"Name"_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,"New Company") Then
Response = acDataErrDisplay
Else
Set db = CurrentDb()
set rst = db.OpenRecordset(tbl"Name")
rst.AddNew
rst("Company") = NewData
rst.update
Response = acDataErrAdded
rst.Close
End If
End Sub
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,"New Company") Then
Response = acDataErrDisplay
Else
Set db = CurrentDb()
set rst = db.OpenRecordset(tbl"Name")
rst.AddNew
rst("Company") = NewData
rst.update
Response = acDataErrAdded
rst.Close
End If
End Sub