Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Kenton, Delaware, USA
    Thanked 0 Times in 0 Posts

    SendObject (2003)

    I have a small work order program. At the end of filling out the Work Order the user has the option to send an alert to the technician who will be working the problem. At first I used the the form as the object and sent it as a text file. The techs didn't like to scroll across the e-mail message to see all of the fields and it didn't print well . I then changed to the following:

    ElseIf DEPARTMENT = "dba" Then
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.SendObject acReport, "rptNewWorkOrder", "SnapshotFormat(*.snp)", "william.hodgson@aa.bbbbb.cccc.ddd", "", "", "New DBA Work Order", "", False, ""

    DoCmd.Close acForm, "Work Order Information"

    Which sends an snap shot attachment with the alert. much as they liked the change they now also want work order data imbedded into the body of the message like they had before the change, because the Blackberries don't handle attachments. Is there a way to send both the snp attachment and also a text file? I am hoping it is a simple matter of just adding a semicolon and a txt file name.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: SendObject (2003)

    SendObject can only send one database object. You could add text to the MessageText argument of SendObject. Here is an example with fictitious names:
    Dim strMsg As String
    strMsg = "Work order no " & Me.WorkOrderNo & vbCrLf & _
    "Dated " & Format(Date, "Short Date") & vbCrLf & _
    "Due in " & Format(Me.DueDate, "Short Date") & vbCrLf & _
    "Please read the attached snapshot document."
    DoCmd.SendObject ObjectType:=acReport, ObjectName:="rptNewWorkOrder", _
    OutputFormat:="SnapshotFormat(*.snp)", To:="william.hodgson@aa.bbbbb.cccc.ddd", _
    Subject:="New DBA Work Order", MessageText:=strMsg, _
    The vbCrLfs in the message text create a new line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts