Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Vba to run a report and then email it?

    I have a report that i have to run weekly and then email to 2 different groups.

    I would like to change a paramater on the qry the report is based on, run the report and send as an attachment to a group via outlook.

    I havent done much vba with access objects, but have sent emails with excel files using .net

    any help appreciated


  2. #2
    Join Date
    May 2004

    Hope this helps

    DoCmd.SetWarnings False
    'this sends an email without opening up each email
    DoCmd.SendObject acSendReport, "YourReportName", acFormatSNP, xtAddress, , , msgtitle, msgbody

    'this opens each mail item.
    DoCmd.SendObject acSendReport, "YourReportName", acFormatSNP, xtAddress, , , msgtitle, msgbody, 0

    'Use the following to validate which type of email you want to send to which group. For example you could change the msgtitle, msgbody or reportname

    If emailtype = 1 then
    end if
    Last edited by gavinfm; 12-06-05 at 11:00.

Posting Permissions

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