D
ddavisCOM
I am trying to email only one page of a report. I know the code to open a
report to a specific record.
Private Sub cmdPreviewReport_Click()
On Error GoTo Err_cmdPreviewReport_Click
Dim stDocName As String
Dim lngRecNum As Long
lngRecNum = Me![ID]
stDocName = "rptStreetClosure"
DoCmd.OpenReport stDocName, acPreview, , "[ID] = " & lngRecNum
Exit_cmdPreviewReport_Click:
Exit Sub
Err_cmdPreviewReport_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewReport_Click
End Sub
and the code to email a report:
Private Sub cmdSendReport_Click()
On Error GoTo Err_cmdSendReport_Click
Dim stDocName As String
stDocName = "rptStreetClosure"
DoCmd.SendObject acReport, stDocName, ,[email address], Etc..
Exit_cmdSendReport_Click:
Exit Sub
Err_cmdSendReport_Click:
MsgBox Err.Description
Resume Exit_cmdSendReport_Click
End Sub
but i don't know how to combine the two to get the result that i what. any
help would be appreciated.
report to a specific record.
Private Sub cmdPreviewReport_Click()
On Error GoTo Err_cmdPreviewReport_Click
Dim stDocName As String
Dim lngRecNum As Long
lngRecNum = Me![ID]
stDocName = "rptStreetClosure"
DoCmd.OpenReport stDocName, acPreview, , "[ID] = " & lngRecNum
Exit_cmdPreviewReport_Click:
Exit Sub
Err_cmdPreviewReport_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewReport_Click
End Sub
and the code to email a report:
Private Sub cmdSendReport_Click()
On Error GoTo Err_cmdSendReport_Click
Dim stDocName As String
stDocName = "rptStreetClosure"
DoCmd.SendObject acReport, stDocName, ,[email address], Etc..
Exit_cmdSendReport_Click:
Exit Sub
Err_cmdSendReport_Click:
MsgBox Err.Description
Resume Exit_cmdSendReport_Click
End Sub
but i don't know how to combine the two to get the result that i what. any
help would be appreciated.