Call Vehicle_Not_Found(Me.Vehicle_ID_ComboBox)
Then replace acct_name_entry with Vehicle_ID_CombobBox
Also need to set the LimitToList property to Yes.
Now I remember why I struggled with this event in the past. The examples referenced don't show how to requery the combobox and retain the new input. This example deals with that http://support.microsoft.com/kb/197526. Seems the acDataErrAdded parameter handles requery of combobox and retaining the input. This simplified code seems to work in your db
CODE IN THE Vehicle_Junction_SubFrm
Code:
Private Sub Vehicle_ID_ComboBox_NotInList(newdata As String, Response As Integer)
If MsgBox("Do you want to add this vehicle?", vbYesNo, "Add vehicle?") = vbNo Then
Response = acDataErrContinue
DoCmd.GoToControl "Vehicle_ID_ComboBox"
Me.Vehicle_ID_ComboBox = Null
Else
DoCmd.OpenForm "Vehicle_Add_Frm", , , , acFormAdd, acDialog, newdata
Response = acDataErrAdded
End If
exit_it:
End Sub
CODE IN THE Vehicle_Add_Frm
Code:
Private Sub Form_Current()
If IsNull(Me.VIN) Then Me.VIN = Me.OpenArgs
End Sub
Thanks for forcing me to get better understanding of NotInList. Think I can go fix some old code now.