Unable to email report (2 Viewers)

vcarrill

Registered User.
Local time
Yesterday, 22:16
Joined
Aug 22, 2019
Messages
60
I'm sure its something simple and I am just overlooking it.

I am using ACCESS 2010, and when I generate my Report under Preview this is what I see:

1602180328733.png


The ability to attach it and email it is not available. Appreciate the advice on being able to email any report I generate.

Thank you
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:16
Joined
Oct 29, 2018
Messages
21,515
Hi. Just a wild guess, but do you have a default email client installed (with a default profile)?
 

vcarrill

Registered User.
Local time
Yesterday, 22:16
Joined
Aug 22, 2019
Messages
60
Hi. Just a wild guess, but do you have a default email client installed (with a default profile)?
Excuse my ignorance, but I read something to this effect but could not find how I do this or check if I have it?

Appreciate you pointing me in the right direction.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:16
Joined
Oct 29, 2018
Messages
21,515
Excuse my ignorance, but I read something to this effect but could not find how I do this or check if I have it?

Appreciate you pointing me in the right direction.
Basically, how would you manually create/start/compose an email on your computer?
 

Isaac

Lifelong Learner
Local time
Yesterday, 21:16
Joined
Mar 14, 2017
Messages
8,842
Is anyone else seeing the OP's original picture like this?

1602181703259.png


I'm unable to glean a lot from that.
 

Isaac

Lifelong Learner
Local time
Yesterday, 21:16
Joined
Mar 14, 2017
Messages
8,842
Any help?

 

vcarrill

Registered User.
Local time
Yesterday, 22:16
Joined
Aug 22, 2019
Messages
60
So you have a default email client.
Yes thank you. I guess i will print to PDF then from there send it to email. Just would be nice to do it directly from Access.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:16
Joined
Oct 29, 2018
Messages
21,515
I'm sure its something simple and I am just overlooking it.

I am using ACCESS 2010, and when I generate my Report under Preview this is what I see:

View attachment 85660

The ability to attach it and email it is not available. Appreciate the advice on being able to email any report I generate.

Thank you
Hi. Regarding the image you posted, can you show us the Print Preview Ribbon as well? Specifically, the Email button? Thanks.
 

mike60smart

Registered User.
Local time
Today, 05:16
Joined
Aug 6, 2017
Messages
1,914
Hi
You would normally have a Command Button usually on a Form which when clicked runs some VBA Code to send a specific Report as an attachment in an EMail.
 

vcarrill

Registered User.
Local time
Yesterday, 22:16
Joined
Aug 22, 2019
Messages
60
Hi
You would normally have a Command Button usually on a Form which when clicked runs some VBA Code to send a specific Report as an attachment in an EMail.
Could you direct me to the code please, thanks.
 

mike60smart

Registered User.
Local time
Today, 05:16
Joined
Aug 6, 2017
Messages
1,914
Hi
It would be along these lines.
You would need to replace names of Reports etc

Code:
Dim OutApp As Object

Dim OutMail As Object

Dim strSubject As String

Dim strTo As String

Dim strBody As String

Dim strDocname As String

Dim strWhere As String



strDocname = "rptNewTask"

strTo = Me.EMail

strWhere = "[EventTaskID]=" & Me!EventTaskID & "





Set OutApp = CreateObject("Outlook.Application")

Set OutMail = OutApp.CreateItem(0)



strBody = "A new task has been allocated." & vbNewLine & vbNewLine & _

"Please process as normal." & vbNewLine & _

"Thank you,"

On Error Resume Next



With OutMail

.Display

.To = Me.EMail

.Subject = "New Task"

.Body = strBody & vbNewLine & .Body

End With



On Error GoTo 0

Set OutMail = Nothing

Set OutApp = Nothing



DoCmd.OpenReport strDocname, acPreview, , strWhere

DoCmd.SendObject acSendReport, "rptNewTask", acFormatPDF, strTo, , strSubject, strBody
 

Isaac

Lifelong Learner
Local time
Yesterday, 21:16
Joined
Mar 14, 2017
Messages
8,842
@mike60smart I was curious on 2 things
1- What is the intent or thinking behind wrapping the With Outmail block in On Error Resume Next?
2- Would this code send the report using DoCmd.SendObject, AND create a blank email for display?
 

Users who are viewing this thread

Top Bottom