Email report

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nothing

    #1

    Email report

    I have a report based on a query that is based agaisnt two tables.

    The report pulls information for 1 customer. The tables may hold
    multipul customers.

    I want to email just the ONE report. All the options that I have found
    to email a report email multipul pages of the report, i.e. it sends all
    the information it can get fomr the query results.

    I am triggering the report via VBA off of a form. There is a button that
    launches the report.

    How exactly do I get Access 2000 to email just the one report I want?

    Thanks,
    Michael Charney

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Larry  Linson

    #2
    Re: Email report

    Create a Query with Criteria limiting the data to the one customer and use
    that in the Report's RecordSource -- as far as I can determine, both the
    Filter and the WhereCondition of DoCmd.OpenRepor t actually _filter_ the
    data.

    That is why, particularly if I am doing multiuser or client-server, I'll
    create a Query with Criteria and in the Report's Open event, use it to
    replace the Report's RecordSource. (If it is multiuser, I make certain that
    the Criteria refers to an Indexed Field in the Table -- so only the index
    will have to be brought across the LAN to select which records to retrieve.)

    Larry Linson
    Microsoft Access MVP



    "Nothing" <me@you.com> wrote in message
    news:3fafde45$0 $201$75868355@n ews.frii.net...[color=blue]
    > I have a report based on a query that is based agaisnt two tables.
    >
    > The report pulls information for 1 customer. The tables may hold
    > multipul customers.
    >
    > I want to email just the ONE report. All the options that I have found
    > to email a report email multipul pages of the report, i.e. it sends all
    > the information it can get fomr the query results.
    >
    > I am triggering the report via VBA off of a form. There is a button that
    > launches the report.
    >
    > How exactly do I get Access 2000 to email just the one report I want?
    >
    > Thanks,
    > Michael Charney
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]


    Comment

    • Nothing

      #3
      Re: Email report

      I know I can do that through a query but my problem is that I want to
      EMAIL the report. using the sendObject or the macro to send the report
      via email it does not give me an option to open it with a WHERE clause
      or filter.

      How can I do this to send the report via email?

      Michael Charney

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Jim Allensworth

        #4
        Re: Email report

        You can't email a report. You can only email the *output* of a report.
        ( RTF, HTML, Snapshot or PDF)

        What version of Access are you using? With A2K there are problems with
        SendObject.

        - Jim

        On 10 Nov 2003 20:31:25 GMT, Nothing <me@you.com> wrote:
        [color=blue]
        >I know I can do that through a query but my problem is that I want to
        >EMAIL the report. using the sendObject or the macro to send the report
        >via email it does not give me an option to open it with a WHERE clause
        >or filter.
        >
        >How can I do this to send the report via email?
        >
        >Michael Charney
        >
        >*** Sent via Developersdex http://www.developersdex.com ***
        >Don't just participate in USENET...get rewarded for it![/color]

        Comment

        • Nothing

          #5
          Re: Email report

          I am using A2K of course.

          I know I can only send the output of the report. The problems is that it
          does not just send the contents of one report.

          It sends multipul pages. If there is data for two reports, one I need
          and a second one is not for me, it sends both reports.

          How can I specifiy just the data I want? Ia m calling the report from a
          form.

          Michael Charney

          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Pieter Linden

            #6
            Q

            Nothing <me@you.com> wrote in message news:<3fb026c8$ 0$195$75868355@ news.frii.net>. ..[color=blue]
            > I am using A2K of course.
            >
            > I know I can only send the output of the report. The problems is that it
            > does not just send the contents of one report.
            >
            > It sends multipul pages. If there is data for two reports, one I need
            > and a second one is not for me, it sends both reports.
            >
            > How can I specifiy just the data I want? Ia m calling the report from a
            > form.
            >
            > Michael Charney[/color]

            If you just *open* the report and pass a filter/valid Where clause,
            then it opens correctly, right? If that's the case, I've been through
            this already. Your only option, I think, is to edit the SQL that the
            report is based on. You could keep a temporary query object in your
            database, change the SQL for it at runtime, and then send the report
            based on that "tweaked" query. Sounds really stupid, I know, but for
            some reason, when you e-mail a report, for some reason it ignores the
            filters... Lyle Fairfield gave me code for it... it's posted here
            somewhere...

            Pieter

            Comment

            • Larry  Linson

              #7
              Re: Email report

              Perhaps I confused the issue with side comments.

              Every report has a RecordSource... before you send the Report, create SQL to
              replace the Report's RecordSource so that the new SQL includes a WHERE
              clause to limit the data selected and save it in a Public string variable in
              a Standard Module. Then in the Report's Open event, put code to pick up the
              new SQL you created and replace the Report's Record Source, as:

              In Report's Open Event:

              Me!RecordSource = MichaelsSQL

              I don't know how to make it any simpler.

              You don't use a DoCmd.OpenRepor t... the Report replaces its own RecordSource
              when it runs, and, as was pointed out, you only send the results of the
              Report.

              As you were told, there was a problem with SendObject in Access 2000. I had
              moved on to a later version by the time Service Pack 3 for Access 2000 was
              released, so I couldn't say if it was fixed or not.

              Larry Linson
              Microsoft Access MVP



              "Nothing" <me@you.com> wrote in message
              news:3faff59c$0 $194$75868355@n ews.frii.net...[color=blue]
              > I know I can do that through a query but my problem is that I want to
              > EMAIL the report. using the sendObject or the macro to send the report
              > via email it does not give me an option to open it with a WHERE clause
              > or filter.
              >
              > How can I do this to send the report via email?
              >
              > Michael Charney
              >
              > *** Sent via Developersdex http://www.developersdex.com ***
              > Don't just participate in USENET...get rewarded for it![/color]


              Comment

              • Pieter Linden

                #8
                Re: Email report

                One way is to create a temporary/holder query that the report you are
                going to mail is based on. then add the filter to the querydef, save
                it, and then send the report. Tedious, yeah, but it does work. then
                you don't have to deal with the e-mailed report mysteriously not being
                filtered. If you save the base query as another querydef, you can
                just copy that querydef's SQL, trim off the semi-colon and then add
                your WHERE clause, and you should be good to go.

                Comment

                Working...