[AccessD] Sending Preformatted Emails

Hollis,Virginia HollisVJ at pgdp.usec.com
Thu Mar 18 09:44:56 CST 2004


Private Sub cmdSendEmail_Click()
On Error GoTo Err_cmdSendEmail_Click

If Len(MatRequestID & "") = 0 Then
        MsgBox "Enter a Request before sending a message." & vbCrLf,
vbCritical, " Entry Required"
    ElseIf Len(RequestorID & "") = 0 Then
        MsgBox "The requestor must be entered." & vbCrLf, vbCritical, "
Entry Required"
        RequestorID.SetFocus
    ElseIf Len(PriorityID & "") = 0 Then
        MsgBox "Please enter a priority." & vbCrLf, vbCritical, " Entry
Required"
        PriorityID.SetFocus
    ElseIf Len(DateNeeded & "") = 0 Then
        MsgBox "The date needed must be entered." & vbCrLf, vbCritical,
"Entry Required"
        DateNeeded.SetFocus
    ElseIf Len(Comments & "") = 0 Then
        MsgBox "A description of the request must be entered." & vbCrLf,
vbCritical, " Entry Required"
        Comments.SetFocus
    Else

Dim Mess As String, Subject As String, Recipient As String, Cc As String,
Bcc As String
Dim Msg, Style, Title, Response, MyString
    PlaySound
Msg = "Do you want to send a notification ?"   ' Define message.
Style = vbYesNo + vbQuestion + vbDefaultButton1 ' Define buttons.
Title = "New Notice Request"  ' Define title.

        ' Display message.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then    ' User chose Yes.
MyString = "Yes"    ' Perform some action.

    Recipient = DLookup("[EmailName]", "qry_Email")
    Subject = "New Materials Request, MMR-" + CStr(Format([MatRequestID],
"00000"))
    Cc = DLookup("[Requestor]", "qry_Requestor",
"[RequestorID]=[Forms]![frm_MaterialsEntry]![RequestorID]")
    Bcc = "Virginia Hollis"
    Mess = "A new Materials Management Request has been submitted, " + _
    "please assign an analyst to complete this request:" + vbCrLf + vbCrLf +
_
    "Materials ID: MMR-" + CStr(Format([MatRequestID], "00000")) + vbCrLf +
_
    "Description: " + [Comments] + vbCrLf + _
    "Need by Date " + CStr([DateNeeded]) + vbCrLf + _
    "Requestor: " + DLookup("[Requestor]", "qry_Requestor",
"[RequestorID]=[Forms]![frm_MaterialsEntry]![RequestorID]") + vbCrLf + _
    "Phone: " + DLookup("[ReqPhone]", "qry_Requestor",
"[RequestorID]=[Forms]![frm_MaterialsEntry]![RequestorID]")
        
On Error Resume Next
DoCmd.SendObject , , , Recipient, Cc, Bcc, Subject, Mess


Else    ' User chose No.
    MyString = "No" ' Perform some action.

End If
    End If
        

-----Original Message-----
From: Mike & Doris Manning [mailto:mikedorism at adelphia.net]
Sent: Thursday, March 18, 2004 9:37 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Sending Preformatted Emails


Can you post the code behind the button so we can see what you are doing
now? 

Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hollis,Virginia
Sent: Thursday, March 18, 2004 10:20 AM
To: 'accessd at databaseadvisors.com'
Subject: [AccessD] Sending Preformatted Emails


This is my week for problems & questions - I am glad everyone has patience
:-)

We just switched to XP (another problem there). I have a database that sends
a preformatted email when a requestor enters a task. The email is sent to an
engineer to complete the task. The email contains the request number, a
description of the request, etc from fields completed on the form.

The problem is since we switched to XP, the user can enter a request and
send only 1 email. If they enter another request, they can't send another
email without exiting the database completely and going back in. So, with
XP, it only permits one email at a time. There isn't an error message, if
the button to send the email is clicked, nothing happens at all.

Has anyone had any problems with this or any suggestions on how to solve the
problem?

Virginia
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list