I've done this countless times before. But for some reason if I enter a new string of characters in this particular combobox, it won't work. I get the message telling me it is a new item and asks if I want to add it, I answer Yes, I get "The text you added isn't an item in the list....."
I don't get it.
Here is the code:
Private Sub cboCompanySoldTo_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_cboCompanySoldTo_NotInList
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox(NewData & " is not in the list. Would you like to add it?", vbQuestion + vbYesNo, "Company")
If intAnswer = vbYes Then
strSQL = "INSERT INTO tblCompaniesLU([Customer]) " & "VALUES ('" & NewData & "');"
CurrentDb.Execute strSQL, dbSeeChanges
Response = acDataErrAdded
MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Description: " & Err.Description & vbCrLf & "Error Source: " & Err.Source