If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
email report with current record
How can I view in a report only the current record displayed in a form, being able also to email it as an attachment,also print it?
|
#2
|
|||
|
|||
email report with current record
Something like the following in your OnClick for a button...
Private Sub Send_Email_Click() On Error GoTo Err_Send_Email_Click Dim msg If (IsNull([some ReferenceOrKey])) Then msg = "Please select a record before creating the email." MsgBox (msg) 'If no record selected, stop procedure Exit Sub End If Dim varSubject As String Dim varText As String Dim varDocName As String Dim varRep As String varSubject = "Your Subject" varText = "Some Text to place in message." varDocName = "NameOfYourReportHere" DoCmd.OpenReport varDocName, acViewPreview, "", "" ' Open the Report DoCmd.SendObject acSendReport, , "Snapshot Format", , , , varSubject, varText, True DoCmd.Close Exit_Send_Email_Click: Exit Sub Err_Send_Email_Click: MsgBox Err.Description Resume Exit_Send_Email_Click Hope that helps, Rick B "Mario" wrote in message ... How can I view in a report only the current record displayed in a form, being able also to email it as an attachment,also print it? |
Thread Tools | |
Display Modes | |
|
|