Not In List Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to allow my user to enter text into a bound combobox with the
rowsource from another table such that if the text is not in the table, it
will automatically add that new text into the table.

I have tried two solutions and in both cases, I get a Enter Parameter Value
prompt for NewData. However, when I just click on the OK button without
entering anything into the prompt, it will still be added. How do get the EPV
prompt not to appear?

My code looks like this (adapted from Dev Ashish's code in the mvps website):

Private Sub txtPaymentTerms_NotInList(NewData As String, Response As Integer)
Set db = CurrentDb
Set rs = db.OpenRecordset("tblPaymentTerms", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!txtPaymentTerms = NewData
rs.Update
Response = DATA_ERRADDED
End Sub

Thanks.
ck
 
Please ignore this question. For some reason, the prompt doesn't appear now.
Thanks.
ck
 
Back
Top