I could really use some help. I can't figure out what I've done. I did a database upgrade, but copied most of my forms and code so it wouldn't take so long to finish. One of the things that I copied was a not in list event that worked fine in the old database. The not in list event is firing, it runs through all of the code, it appends the data to the table but I still get the "The text you entered isn't an item in the list" error. Here is the code:
Code:
Private Sub cboVendor_NotInList(NewData As String, Response As Integer)
On Error GoTo HandleErrors
Dim ctl As Control
DoCmd.SetWarnings False
' Return Control object that points to combo box.
Set ctl = Me.cboVendor
' Prompt user to verify they wish to add new value.
If MsgBox("Value is not in list. Add it?", _
vbOKCancel) = vbOK Then
' Set Response argument to indicate that data
' is being added.
Response = acDataErrAdded
DoCmd.RunSQL "INSERT INTO tblVendor (VendorName) Values ('" & UCase(SQLFixup(NewData)) & "');"
Else
' If user chooses Cancel, suppress error message
' and undo changes.
Response = acDataErrContinue
ctl.Undo
End If
ExitHere:
Exit Sub
HandleErrors:
MsgBox err.Number & " " & err.Description
Resume ExitHere
End Sub