Capture VBok and VBNo

  • 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
 
If MsgBox(strMessage, vbNo = 2) Then

Use

If VbNo = Msgbox strMessage, vbYesNo Then
'Your code here
End If

Some of the more common constant you can use are VbYes, VbNo, VbOk, VbCancel;
I always find it is easiest to set up your If statement like I have it above.

HTH,

Nick
 
When I use False as the send for email, I get the outlook message "a program
is trying to send a email on your behalf, do you want to allow this" with a
yes or no button. How do I capture the button clicked in this case?
 
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

Answered elsewhere.
Please do not multi-post. If you feel you must post the same question
to more than one newsgroup (and it's seldom necessary), cross-post by
adding each additional newsgroup in the To Newsgroups: box, separated
by a comma.
This way an answer in one newsgroup will be seen in each of the
others. More readers will see the response and learn, and less time
will be spent on duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.
 
Dim Response

Response = Msgbox strMessage, vbYesNo
If Response = vbYes Then
'Click was a Yes
Endif

Ron
 
Back
Top