Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009

    Unanswered: Export Code DoCmd.

    Hi all,

    I currently use the following code;

    TheDate = Year(Date) & "-" & Month(Date) & "-" & Day(Date)

    TheFile = "FILESHARE\Jamie Nightingale\Daily Broadsheets\Daily Broadsheet_" & TheDate & ".snp"

    DoCmd.OutputTo acOutputReport, "rpt_agent_broadsheet_jamie", "SnapshotFormat(*.snp)", TheFile, False, ""

    I repeat this code for each of my agents and have seperate queries and forms for each one. Is it possible to get some code that would run and export a single report based upon a table list;

    Joe Bloggs C:\My docs\Joe Bloggs
    Peter Pan C:\My docs\Peter Pan

    Hope this makes sense.


  2. #2
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    It is possible, though I would point out it's almost certainly a mistake to have separate queries/forms/reports for each agent. That presumes their data is in the same table, and the only difference between the queries/etc is a parameter to select only that particular agent's data. The "proper" method is to have one query/form/report and use one of several methods to filter to a particular agent.

    I would dump all that and use a technique like this to filter the report, and the linked code to loop through and export each (exporting rather than emailing):

    Emailing a different report to each recipient

Posting Permissions

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