I have selected to use the vbYesNo MsgBox in my coding. My dilemma comes when the message box appears. I click on Yes and it runs the remaining code; I click on No and it still runs the code instead of ending the sub routine. How do I make the Yes and No buttons on the MsgBox work so that when I click on No, it will end the sub routine?
Code:
Dim strMsg As String, stDocName As String, stLinkCriteria As String
strMsg = "There is no Telephone Number assigned to the Consignee. Do you want to add a Telephone Number?"
stDocName = "frmCustomerInfo"
stLinkCriteria = "[CustomerNumber]=" & Me![Consignee]
If CallForAppointment = True Then
If IsNull(Forms!frmQuoteOrderEntry!Customer_subform2!Telephone) Then
MsgBox strMsg, vbYesNo, "Missing Consignee Telephone"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
Else
PurchaseOrder.SetFocus
End If
Else
PurchaseOrder.SetFocus
End If