NotInList Error

A

Aria

I added the code to add data to a combo box if it does not already appear in
the list. However, I am getting the following error:

"The expression Not In List you entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name."

This error is also displayed whenever I click on any of the other buttons on
my form. The code for these buttons has not changed.

Can anyone please help??
 
A

Aria

Private Sub cmbBRDescr_NotInList(NewData As String, Response As Integer)

Dim strSQL As String
Dim i As Integer
Dim Msg As String

'Exit this sub if the combo box is cleared
If NewData = "" Then Exit Sub

Msg = "Issue Description is not in list. Add?"
i = MsgBox(Msg, vbQuestion + vbYesNo, "Issue Description Not Found")
If i = vbYes Then
strSQL = "Insert Into tblBRDescr (BRDescr) values (Me.BRDescr,'" &
NewData & "')"

CurrentDb.Execute strSQL, dbFailOnError

Response = acDataErrAdded
Else
Response = acDataErrContinue
End If

End Sub
 
Top