View Full Version : Loops in SendObject command


Webmaster@worksnotfun.com
02-26-2002, 06:52 AM
I'm really stuck. I have a form which I have set up a cmdbutton. There are 3 different thing that can occured, an approval (check mark), a reject (check mark) or an interim (check mark). I would like the user to click the command button, and if the part check mark is approved, it would send a email message, or it rejected, send an email messgae. I can only get this to work, if I sent up 3 different buttons, one for approval, reject & interim status.

Jerry Stoner
02-26-2002, 08:43 AM
Private Sub cmdSendMail_Click()
If chkQuote.Value = -1 Then
DoCmd.SendObject acReport, "Quote", _
"Rich Text Format(*.rtf)", _
[Forms]![frmEmailInv]![txtEmailAdd], _
"", "", "Quote", "", False, ""
MsgBox "E-Mail has been sent"
End If
If chkQuote.Value = 0 Then
DoCmd.SendObject acReport, "Invoice", _
"Rich Text Format(*.rtf)", _
[Forms]![frmEmailInv]![txtEmailAdd], _
"", "", "Invoice", "", False, ""
MsgBox "E-Mail has been sent"
End If
If chkPastDue.Value = -1 Then
DoCmd.SendObject acReport, "Past Due Invoice", _
"Rich Text Format(*.rtf)", _
[Forms]![frmEmailInv]![txtEmailAdd], _
"", "", "Invoice", "", False, ""
MsgBox "E-Mail has been sent"
End If
End Sub

This should get you close.

Webmaster@worksnotfun.com
02-27-2002, 07:10 AM
Thanks a MILLION, it works like a charm. I'm thinking of naming my first born Stoner!

Jerry Stoner
02-27-2002, 07:23 AM
You really wouldn't do that to a poor defenseless child would you?