By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,990 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,990 IT Pros & Developers. It's quick & easy.

Email report

P: n/a
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!
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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.OpenReport 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:3f*********************@news.frii.net...
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!

Nov 12 '05 #2

P: n/a
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!
Nov 12 '05 #3

P: n/a
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:
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!


Nov 12 '05 #4

P: n/a
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!
Nov 12 '05 #5

P: n/a
Nothing <me@you.com> wrote in message news:<3f*********************@news.frii.net>...
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


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
Nov 12 '05 #6

P: n/a
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.OpenReport... 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:3f*********************@news.frii.net...
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!

Nov 12 '05 #7

P: n/a
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.
Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.