How To Capture VBok or VBNo button clicked

  • Thread starter Thread starter Lance F via AccessMonster.com
  • Start date Start date
L

Lance F via AccessMonster.com

I’m using the automatic send email by using false as the 9th sendObject.

How do I capture the ‘yes” or “no” that is clicked on the popup. Here is my
code:

DoCmd.SendObject acSendNoObject, , , frmActive.AssignedTo.Column(1), , , , ,
False
If MsgBox(strMessage, vbNo = 2) Then
MsgBox "You Chose Not To Send Email. This Issue Will Not Be Save."
Else
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
End If

Thanks,
Lance
 
I’m using the automatic send email by using false as the 9th sendObject.

How do I capture the ‘yes” or “no” that is clicked on the popup. Here is my
code:

DoCmd.SendObject acSendNoObject, , , frmActive.AssignedTo.Column(1), , , , ,
False
If MsgBox(strMessage, vbNo = 2) Then
MsgBox "You Chose Not To Send Email. This Issue Will Not Be Save."
Else
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
End If

Thanks,
Lance
The email is already sent by the time you ask whether or not to send
it. I don't think that is what you want.

Place the SendObject in the Else section of the If..Then .. Else. It
will only be sent if Yes is clicked.

Here is how you determine which button was clicked.

If MsgBox(strMessage, vbYesNo) = vbNo Then
MsgBox "You Chose Not To Send Email. This Issue Will Not Be Save."
Else
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SendObject acSendNoObject, , , frmActive.AssignedTo.Column(1)
, , , , , False
DoCmd.GoToRecord , , acNewRec
End If
 
Lance F via AccessMonster.com said:
I’m using the automatic send email by using false as the 9th sendObject.

How do I capture the ‘yes” or “no” that is clicked on the popup. Here is my
code:

DoCmd.SendObject acSendNoObject, , , frmActive.AssignedTo.Column(1), , , , ,
False
If MsgBox(strMessage, vbNo = 2) Then
MsgBox "You Chose Not To Send Email. This Issue Will Not Be Save."
Else

If MsgBox(strmessage, vbYesNo) = vbNo Then
MsgBox "You Chose Not To Send Email. This Issue Will Not Be Save."
Else
 
Back
Top