SendObject Problem

G

Guest

every time I try to run VBA code with sendobject, I get an email with an
attached excel icon. The email should contain specific fields from my report.
Should I add a requery to my code?
 
R

Rick Brandt

Larry06Green said:
every time I try to run VBA code with sendobject, I get an email with
an attached excel icon. The email should contain specific fields from
my report. Should I add a requery to my code?

Lets see your code.
 
G

Guest

Here's the code, user supplies a project starting date and combo62 equals a
department name. Combo64 equals a projectID number.

Private Sub Combo62_AfterUpdate()
Me.Combo64 = Null
Me.Combo64.Requery
Me.Combo64 = Me.Combo64.ItemData(0)
End Sub

Private Sub Combo64_AfterUpdate()
With Forms!FRMTEST1
..SetFocus
..Requery
End With

End Sub

Private Sub Exit_Click()
On Error GoTo Err_Exit_Click

DoCmd.Close
DoCmd.OpenForm "Switchboard", acNormal

Exit_Exit_Click:
Exit Sub

Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click
End SubPrivate Sub Mail_Project_Notice_Click()
On Error GoTo Err_Mail_Report_Click
Dim stDocName As String
Dim stDocName1 As String

stDocName = "qryt2"
stDocName1 = "rptProject_Update_Email"


DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SendObject acReport, stDocName1, "HTML(*.html)", , , , "Project Update
Notification"

DoCmd.Close acQuery, "qryt2"

Exit_Mail_Report_Click:
Exit Sub

Err_Mail_Report_Click:
MsgBox Err.Description
Resume Exit_Mail_Report_Click

End Sub
 
G

Guest

I posted a request for help on this same issue in "Reports." I see the same
problem in this forum twice just in March so here's my two cents

Access 2003

I am sending a report with a formatted Email message in SNP format using a
form. From time to time the report will show up on the email attached as an
Excel Spreadsheet with a system generated file name (and extension XLS). Of
course when you open the file, it appears as gibberish.

The command line in my code looks like this:

DoCmd.SendObject acSendReport, stDocName, acFormatSNP, msgTo, msgCC, msgBCC,
msgSub, msgBod

I've been able to fix the problem by changing the Caption in Report
Properties. This will correct the problem for awhile.

As this seems to be occurring more often lately I'd like to know if this is
documented anywhere and if there is a permanent fix I can apply.

Thanks!

Bill
 

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

Top