email in access

C

Chey

I found this code

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 [Travel Request 0 Layover], acViewPreview,,,"[TA
Number]=[TA Number]

DoCmd.SendObject objecttype:=acSendReport, _
ObjectName:=strRpt, outputformat:=acFormatSnapshot, _
To:=[Acting Manager Email], Subject:=[TA Number] & "has been approved."

I added in my information but do not understand

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

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

this part

All I want to do is send a report as an attachment in an email. To an email
address that is on the form.

I have a command button on my form now. When I push the button, I want it
to print one copy and send an email.

Can you please help me quickly. I would really like to get this going. I
have attempted other email codes and so far been somewhat sucessful.

Thanks for all your help
 
C

Chey

Okay now I am getting somewhere
DoCmd.OpenReport "Travel Request 0 Layover", , , "[TA Last
3]=[Forms]![Travel Request 0 Layover]![TA Last 3]"
DoCmd.SendObject acSendReport, "Travel Request 0 Layover", acFormatRTF,
"[Acting Manager Email]", , , "Approved", , True

I have opened the report now I want to only send that page.
Right now it prints and is going to email all the records in that report
when it prints everythings is right. When I email it emails way to much.
Thanks
 
T

Tony Toews

Chey said:
I have opened the report now I want to only send that page.
Right now it prints and is going to email all the records in that report
when it prints everythings is right. When I email it emails way to much.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top