Results 1 to 2 of 2
Thread: SendObject (2003)
2006-08-08, 13:40 #1
- Join Date
- Jun 2001
- Kenton, Delaware, USA
- Thanked 0 Times in 0 Posts
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.SendObject acReport, "rptNewWorkOrder", "SnapshotFormat(*.snp)", "firstname.lastname@example.org", "", "", "New DBA Work Order", "", False, ""
DoCmd.Close acForm, "Work Order Information"
Which sends an snap shot attachment with the alert.
Well....as 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.
2006-08-08, 13:58 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 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:="email@example.com", _
Subject:="New DBA Work Order", MessageText:=strMsg, _
The vbCrLfs in the message text create a new line.