Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form email button to automatically attach a report containing Ole logo. 2

Status
Not open for further replies.

cimoli

Technical User
Jul 30, 2010
207
US
From my reading over the years, I bet this is still not possible. But maybe a 3rd party software exists? I a report "Travel Reservation" which i would like to hit an Access 2010 form button that pulls up MS Outlook (or anything you recommend) and automatically attached the report, and still keep our company logo Ole in the report, and lines, and signature Ole.

But I bet that is not possible. Any ideas?

I see this as an important item that MS did not help on, except for the Snapshot program that i read about. However, it is not feasible to ask 10,000 homeowners receiving their reservations to first download Snapshot. Or tell the Casino Hotels to do the same for our room reservation list.

I saw something called FMS but am not sure if it does what i need. Thanks you for any advice.

 
Have you tried the macro action EmailDatabaseObject?
Output format should be: PDF Format (*.pdf)

Leave other fields blank except for Edit Message - leave it Yes

--Lilliabeth
 
Lilliabeth - interesting. I tried Pdf and it may work for us. I am awaiting a friend to see if he can Read the pdf attachment (without having adobe reader on his PC) and if he can print the reservation (without adobe). I have adobe on my Pc, so i need a test with someone without adobe.

if this works, then we can send emails to customers instead of regular postal mail.

The logo and lines work with Pdf.

From your message, I can try that button deal. I will let you know how i made out. thanks so much.
 
I made progress. I now have a working Email button on my Access 2010 form.
Could someone review my work? I am not a VBA person per se.
I noted in GREEN down below the command that i am not familiar with.
DoCmd.SendObject acReport, stDocName, acFormatPDF

Also, I am not sure if I should have that sendobject in more than 1 place.
You see, in my button, there are 2 possible report choices.
The ReportNum field decides which one to use for a given Hotel.

The SendObject examples on the internet were exotic with many parameters.
So I worry that I did not get this exactly right. Can you check my work?
You can criticize all you want because this coding is not my ballywick.
Thanks. Cimoli.


Private Sub cmdEmailReport_Click()
'We have 2 kinds of reports based on group or non group walkin reservations.
'1- a regular Group reservation report #10 that uses report rptTicketIND and
'2- a Splinter NON Group reservation #20 that uses report rptTicketSplinterInd.


On Error GoTo Err_cmdEmailReport_Click

Dim lResort As Long, sReportNameSpl As String, sReportNameInd As String
lResort = Me.txtResortID


'Check to see if you have a proper resort number.
If Nz(DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=20"), "") = "" Then
MsgBox "No Resort Available"
Exit Sub

Else

'Dlookup gets the splinter reservation report NAME needed for code 20.
sReportNameSpl = DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=20")
End If

'Otherwise, Dlookup gets the Group reservation for 1 person report NAME needed for code 10.
sReportNameInd = DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=10")


If Not IsNull(Forms![frmReservation]!txtSplinterDateIN) Then
DoCmd.OpenReport sReportNameSpl, acViewPreview

Else

DoCmd.OpenReport sReportNameInd, acViewPreview

'Put email send object here ?????? also need to tell it is automatically a PDF format. How?
DoCmd.SendObject acReport, stDocName, acFormatPDF

Exit_cmdEmailReport_Click:
Exit Sub

Err_cmdEmailReport_Click:
MsgBox Err.Description
Resume Exit_cmdEmailReport_Click

End If
 
I see now the 2nd place to put the DoCmd.SendObject acReport, stDocName, acFormatPDF.
I marked them in Purple below. Can someone check my work. The button seems to work.
slight delays but works in the end. Cimoli.


Private Sub RoomServiceNote_DblClick(Cancel As Integer)
RunCommand acCmdZoomBox
End Sub


Private Sub cmdEmailReport_Click()
'We have 2 kinds of reports based on group or non group walkin reservations.
'1- a regular Group reservation report #10 that uses report rptTicketIND and
'2- a Splinter NON Group reservation #20 that uses report rptTicketSplinterInd.


On Error GoTo Err_cmdEmailReport_Click

Dim lResort As Long, sReportNameSpl As String, sReportNameInd As String
lResort = Me.txtResortID


'Check to see if you have a proper resort number.
If Nz(DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=20"), "") = "" Then
MsgBox "No Resort Available"
Exit Sub

Else

'Dlookup gets the splinter reservation report NAME needed for code 20.
sReportNameSpl = DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=20")
End If

'Otherwise, Dlookup gets the Group reservation for 1 person report NAME needed for code 10.
sReportNameInd = DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=10")


If Not IsNull(Forms![frmReservation]!txtSplinterDateIN) Then
DoCmd.OpenReport sReportNameSpl, acViewPreview
DoCmd.SendObject acReport, stDocName, acFormatPDF
Else

DoCmd.OpenReport sReportNameInd, acViewPreview

'Put email send object here ?????? also need to tell it is automatically a PDF format. How?
DoCmd.SendObject acReport, stDocName, acFormatPDF

Exit_cmdEmailReport_Click:
Exit Sub

Err_cmdEmailReport_Click:
MsgBox Err.Description
Resume Exit_cmdEmailReport_Click

End If
 
Replace stDocName with the corresponding sReportNameSpl and sReportNameInd

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, that works great.
I took out 2 rows since i only want to email it and not
preview it.

DoCmd.OpenReport sReportNameSpl, acViewPreview

DoCmd.OpenReport sReportNameInd, acViewPreview

thanks for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top