Included below is my vbcode. The code is initiated from a button on a form. It pops-up another box asking the operator if it is OK to proceed or Cancel. Problem - when Cancel is requested the code terminates fine, however, when OK is hit the vb code window opens. Am I not terminating the code correctly? Is there another way to accomplish this? Thanks in advance.
Private Sub UpdateDisp_click()
Dim sMsgReply As String
sMsgReply = MsgBox("Hit OK to make changes or CANCEL to quit.", vbOKCancel, "Caution! - toggles & updates ALL outages to Dispatched."
If sMsgReply = vbOK Then
DoCmd.RunMacro ("UpdateDisp Macro"
Else
DoCmd.CancelEvent
End If
End Sub
Private Sub UpdateDisp_click()
Dim sMsgReply As String
sMsgReply = MsgBox("Hit OK to make changes or CANCEL to quit.", vbOKCancel, "Caution! - toggles & updates ALL outages to Dispatched."
If sMsgReply = vbOK Then
DoCmd.RunMacro ("UpdateDisp Macro"
Else
DoCmd.CancelEvent
End If
End Sub