I'm using a combo-box to present users with a list of people to select from. If the name is not in the list I have the following code:
Dim i As Integer
Dim Msg As String
'Exit this sub if the combo box is cleared
If NewData = "" Then Exit Sub
Msg = "'" & NewData & "' is not currently in the list." & vbCr & vbCr
Msg = Msg & "Do you want to add this new Person?"
i = MsgBox(Msg, vbQuestion + vbYesNo, "Unknown Person...")
If i = vbYes Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Add_Person"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
End If
I enter a new name in the combo box but the Add_Person form never opens. I also added another End if but same result. I need the form to open so the user can also enter the address and phone number for the new person.
Thanks!