Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    64

    Unanswered: Select which report I want to email

    Trying to find how to email a selected report from Access. Using the examples below I have for print and view in reports.

    Private Sub PrintReports_Click()
    Dim X As Variant
    For Each X In ReportList.ItemsSelected
    DoCmd.OpenReport ReportList.ItemData(X), acViewNormal
    Next
    End Sub

    Private Sub ViewReports_Click()
    Dim X As Variant
    For Each X In ReportList.ItemsSelected
    DoCmd.OpenReport ReportList.ItemData(X), acViewPreview
    Next
    1.Could someone also include an example to email the report.
    2. At times I get this (Run-time error '2501') what's happening?

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try the next:

    For Each selectedItem In List_Tables.ItemsSelected
       DoCmd.SendObject combo_sendAs, List_Tables.ItemData(selectedItem), combo_outputFormat, txt_eMail, _
       txt_cc, , txt_Betreff, txt_MessText, False
    Next

  3. #3
    Join Date
    Aug 2003
    Posts
    64
    Look at this,

    Private Sub MailReport_Click()
    Dim X As Variant
    For Each X In ReportList.ItemsSelected
    DoCmd.SendObject ReportList.ItemData(X), acSendReport

    Next
    End Sub

    Could you modify from your example to what I have, these are reports. When I click a button from a form a pop up box shows each report(10). From there I would select which one I want to email.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •