E-mail Report?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having trouble figuring out how to e-mail a single report (ex."bid
form"). When I try to send it as a snapshot the database sends all bid forms.
I have a list box that shows different fields and check boxes for the type of
report I want to email. I would like to be able to email which one I want and
also choose the report I want, hit a button and automatically email the
single report. Any help will be greatly appreciated.

Happy Holidays!
 
You need to use form variables in your code to open the report. Something
like:

Dim strRpt As String
Dim lngID As Long
Dim strEmail As String

strRpt = Me.lstReportNames
lngID = Me.lstCompanyID
strEmail = Me.lstCompanyID.Column(2)

DoCmd.OpenReport strRpt, acViewPreview,,,"ID=" & lngID

DoCmd.SendObject objecttype:=acSendReport, _
ObjectName:=strRpt, outputformat:=acFormatSnapshot, _
To:=strEmail, Subject:="Bid"
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
I'm not the most savvy access person in the world. What is Me.1stReportNames?
Thanks for the quick reply you gave.
 
I'm not sure I understand your question: you merely want to be able to
email the results of the report, as though it printed out, or the
actual design of the report? Or is it that you want to only email one
PART of the report, not the report for every entry in the database?

It sounds as though you've already tried to right-click on the report
in the database overview window (don't know if that's the right term -
it's where you see a listing of all tables, queries, forms, reports,
etc.), where you choose "Send To->" and "Mail Recipient" and then
choose the type of file output. Have you tried a different file format,
as opposed to "Snapshot"?

If you're using a more recent version of Access, like 2003 - I suggest
using the "Publish it with Word" feature (Tools->Office Links->Publish
It with Microsoft Office Word). Save the published document, make the
edits you need, and attach the Word document to your email.

If you're looking for something more automated, you'll probably have to
get into some VB scripting and automation - not that I've done that,
but my techno-geek/mage brother-in-law has.

It also sounds like you might be using a switchboard, rather than
working directly with the reports. If so, I suggest bypassing the
switchboard; if that's not the case, I apologize for assuming something
that isn't there.
 
thanks to both of you for the replies

i probably haven't made it real clear on what I'm trying to do(haven't been
right since New Years) On a form I have a box that shows different fields on
the side I have the names of the reports with check boxes besides them. I
would like to highlight a particular line in the :"list box?" check the
report that i want to send and e-mail the report only pertaining to which
field i want. Dont know if that makes any sence.

example:

I snail mail bid forms to contractors. I would like to have the capability
to e-mail them. When I try to use the send to or publish it with microsoft
the database wants to send out 500 bid forms.

I have set it up where I can print out only one and not all 500, so I'm
thinking there is a way to do the same with e-mail.
 
Back
Top