I'll admit first up that I have just copied an example of the Not On List event as I don't know VB code at all and have made changes that I had hoped would work. I use a form which pulls inform from another table via a combo box. The table is named "Sire" and the column name of "Name".
When I enter a new name that isn't on the list I am getting the error "The text you entered isn't an item on the list" "Select an item from the list, or enter text that matches one of the listed items"
I summize that the code is correct up until the MsgBox part but as I said I really don't know the code language and need some help fixing it.
Below is the code I have for the event.
Private Sub Sire_NotInList(NewData As String, Response As Integer)
Dim ctl As Control
' Return Control object that points to combo box.
Set ctl = Me!Sire
' 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
' Add string in NewData argument to row source.
ctl.RowSourceType = "Table/Query"
ctl.RowSource = "Sire"
' If user chooses Cancel, suppress error message
' and undo changes.
Response = acDataErrContinue