Hello! I would appreciate any help! I have an adp form that has a "Vendor Name" combo box. The combo box is bound to a vendor table. The form that the combo box is on is actually unbound. Anyway, I have an "On Not In List" event that fires when a new vendor is put into the combo box. However, it doesn't seem to be working. I'm not sure why. Here is the code that I have. It works fine in other databases, just not this one!
SQLFixup is code off of the microsoft web site that formats the new data. Again, this works fine in other databases. When I try to use this, I get the error "THE TEXT YOU ENTERED ISN'T AN ITEM IN THE LIST." Obviously, if the code worked, I wouldn't get this message.
When I go to the table, the item has been entered. How exactly do I take care of this issue? Why doesn't it recognize the acDataErrAdded variable?
Thank you in advance for any help!
Code:
Private Sub cboVendor_NotInList(NewData As String, Response As Integer)
On Error GoTo HandleErrors
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO tblVendor (VendorName) Values ('" & SQLFixup(NewData) & "');"
Response = acDataErrAdded
Me.cboVendor.Requery
ExitHere:
Exit Sub
HandleErrors:
MsgBox err.Number & " " & err.Description
Resume ExitHere
End Sub
SQLFixup is code off of the microsoft web site that formats the new data. Again, this works fine in other databases. When I try to use this, I get the error "THE TEXT YOU ENTERED ISN'T AN ITEM IN THE LIST." Obviously, if the code worked, I wouldn't get this message.
When I go to the table, the item has been entered. How exactly do I take care of this issue? Why doesn't it recognize the acDataErrAdded variable?
Thank you in advance for any help!