Here are a couple of examples also:
Example 1 - Inserting a new item directly into the lookup table behind the scenes ....
Private Sub cboCONTACT_ID_NotInList(NewData As String, Response As Integer)
Dim myVar
Dim ctl As Control
Dim lresponse As Long
Set ctl = Me.cboCONTACT_ID
If MsgBox(NewData & " is a new item. Do you wish to add it to the combo box?", vbYesNo, "Add Item") = vbYes Then
'add the new record
CurrentDb.Execute "insert into tbl_contacts ( [contact_NAME] ) values ('" & NewData & "');"
Response = acDataErrAdded
Else
myVar = Me.cboCONTACT_ID
Response = acDataErrContinue
ctl.Undo
End If
End Sub
Example 2 - 'Form2' is a simple form connected to the list table
Private Sub Combo1_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is a new item. Do you wish to add it to the combo box?") = vbYesNo Then
DoCmd.OpenForm "Form2", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
Else
Response = acDataErrContinue
Me.Combo1.Undo
End If
End Sub
mx