11 Jun 12 17:03
PHV - thanks for the tip. I am not sure how to use it. I put it below inside 2 lines.
1 - Do i have to add something to the DIM ?
2 - I imagine you wanted me do something further with the .... strTOvalueHere.
3 - On my form, i have a field name of EMAIL55 that contains the email address.
Can you advise? Thanks much. 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"
'Dlookup gets the splinter reservation report NAME needed for code 20.
sReportNameSpl = DLookup("ReportName", "tblReport", "[Resort#]=" & lResort _
& " AND [ReportNum]=20")
'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.SendObject acReport, sReportNameSpl, acFormatPDF, strTOvalueHere
DoCmd.SendObject acReport, sReportNameInd, acFormatPDF, strTOvalueHere