I have the following code on a form. It works fine, however, I would like to force the NO button to be the default when this message box comes up. Also, somehow show that NO is pre-selected for them by changing the appearance of the NO box.
Private Sub DeleteBtn_Click()
On Error GoTo Err_DeleteBtn_Click
Dim strMsg As String
strMsg = "Do you wish to delete this vendor and all related information?"
strMsg = strMsg & " Click Yes to Continue with Deletion. Click No to Cancel."
If MsgBox(strMsg, vbQuestion + vbYesNo, "WARNING! DELETE VENDOR?"
= vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
DoCmd.CancelEvent
Me![VENDOR].SetFocus
End If
Exit_DeleteBtn_Click:
Exit Sub
Err_DeleteBtn_Click:
MsgBox Err.Description
Resume Exit_DeleteBtn_Click
End Sub
Thanks!
Linda
Private Sub DeleteBtn_Click()
On Error GoTo Err_DeleteBtn_Click
Dim strMsg As String
strMsg = "Do you wish to delete this vendor and all related information?"
strMsg = strMsg & " Click Yes to Continue with Deletion. Click No to Cancel."
If MsgBox(strMsg, vbQuestion + vbYesNo, "WARNING! DELETE VENDOR?"
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
DoCmd.CancelEvent
Me![VENDOR].SetFocus
End If
Exit_DeleteBtn_Click:
Exit Sub
Err_DeleteBtn_Click:
MsgBox Err.Description
Resume Exit_DeleteBtn_Click
End Sub
Thanks!
Linda