I'm not able to get this Not In List event to function on this form.
The event opens another form to add the data to the table that supplies the values to the combo box.
The data is entered into the table.
However, the combo box does not immediately show the new value and I get the message that MS Access cannot find the related data.
I've attached a piece of the database with the forms.
I use this same code and entry form on other not in list events without issue - which leads me to believe the issue might be related to the structure of the combo box.
Here is the code:
The event opens another form to add the data to the table that supplies the values to the combo box.
The data is entered into the table.
However, the combo box does not immediately show the new value and I get the message that MS Access cannot find the related data.
I've attached a piece of the database with the forms.
I use this same code and entry form on other not in list events without issue - which leads me to believe the issue might be related to the structure of the combo box.
Here is the code:
Code:
Private Sub SupplementalReviewer_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
Me.SupplementalReviewer.Undo
Call Reviewer_Not_Found(NewData)
Me.SupplementalReviewer.Value = NewData
End Sub
Public Sub Reviewer_Not_Found(NewData)
Dim ans As Variant
gbl_exit_name = False
ans = MsgBox(NewData & " is not a listed reviewer in the Database. Do you want to add them?", _
vbYesNo, "Add New Reviewer?")
If ans = vbNo Then
Me.SupplementalReviewer = Null
DoCmd.GoToControl "Reviewer"
GoTo exit_it
End If
DoCmd.OpenForm ("frmEnterNewReviewer")
Form_frmEnterNewReviewer.Reviewer = NewData
DoCmd.GoToControl "Reviewer"
exit_it:
End Sub