bob fitz
AWF VIP
- Local time
- Today, 16:27
- Joined
- May 23, 2011
- Messages
- 4,727
I have the following code in the NotInList event of an unbound combo box but the combo doesn't recognize added data unless it is selected from the list. It just repeats the message saying that the new data is not in the list .
I have also attached a db to illustrate the problem.
I have also attached a db to illustrate the problem.
Code:
Private Sub Combo0_NotInList(NewData As String, Response As Integer)
If MsgBox("Add '" & NewData & "' to the list?", vbQuestion + vbYesNo, "Confirmation Required") = vbYes Then
CurrentDb.Execute "insert into tblHrRate (HrRate) VALUES ( """ & NewData & """ );"
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub