Pleading for Help

M

MikeS

I have posted this question a few times but have not gotten any response.
Hopefully, someone can give me some direction on how to resolve this issue.

Here is the code I have for emailing a report.

DoCmd.SendObject acSendReport, strReportName, acFormatHTML, strRec, , , _
"Mal " & strTitleName & " - " & MyDate, , False, ""

The report works fine as long as it is not more than 1 page. If more than
one, I get a general message "Microsoft Access has encountered a problem and
must shut down".

In addition, the report shows up as an Excel attachment instead of being in
HTML format in the body of the text message.

Can anyone give me any feedback on this?

Thanks in advance,
MikeS
 
M

MikeS

Gina,

Here is the entire code for the module:

Option Compare Database
Public strReportName As String
Public strTitleName As String

Function Mal_Lab_Report()
On Error GoTo Err_Mal_Lab_Report
Dim MyDate As String
Dim strRec As String

MyDate = Format(Now(), "mm/dd/yyyy")
strRec = "(e-mail address removed)"
DoCmd.SendObject acSendReport, strReportName, acFormatHTML, strRec, , , _
"Mal " & strTitleName & " - " & MyDate, , False, ""

Exit_Mal_Lab_Report:
Exit Function

Err_Mal_Lab_Report:
MsgBox Err.Description
Resume Exit_Mal_Lab_Report

End Function

strReportName and strTitleName are set by a form depending on which
particular report we are running.

At one point, the email report was working fine with the report being in
HTML format in the body of the email. But for whatever reason, suddenly it
started appearing as an Excel attachment. Also, if the report is more than
one page, I get the error "Microsoft Access has encountered a problem and
must shut down".

Any help you could give me on this would be greatly appreciated.

MikeS
 
M

MikeS

That still doesn't fix the problem. I tried removing all the arguments back
to "MyDate" and I still get the same problems. Please don't give up on
me....you're the only one that has responded :)

Mike
 
J

Jack Leach

Here is the entire code for the module:
Option Compare Database
Public strReportName As String
Public strTitleName As String
[...]


Put an Option Explicit following Option Compare Database at the top of every
module you have and recompile all modules. If you don't get any errors
consider yourself extremely lucky.

Under options in the VBE there's a checkbox somewhere for "Require Variable
Declaration". Checking this will automatically put it there for any new
modules you create but you will still need to do it for all your existing
(this includes form modules).

hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
M

MikeS

Gina,

I am using Windows XP Service Pack 2, Microsoft Office Service Pack 3, and
my default email is Lotus Notes 7.0.2

As I mentioned, the code was working at one point, but for some unexplained
reason, it is now putting the report as an Excel attachment. In addition, if
the report is more than one page, it gets an error.

Let me know if I can give you anymore information.

Thanks,
MikeS
 
G

Gina Whipp

Mike,

First let me say that I did not abandon you... I was a little busy today and
did not get back here.

Now, I was good up until you said Lotuc Notes... I was going to run a test
but well, that won't work. I do however, seem to recall some issues with
Microsoft Office SP3 which is why I have not even installed it yet and have
steered my Clients away from it... I am handling that little SP one at a
time.

I did find this which might apply to you as you are using Lotus Notes...

http://support.microsoft.com/kb/555020

Let's see if the above solution fixes the issue with .xls files then we can
move on to the more than one page issue.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
M

MikeS

Gina,

I'm sorry if I implied that you abandoned me. I did not mean for it to
sound that way. I'm actually very happy that you have stuck with me on this.
Since we have not yet found a resolution, I have change the format to "RTF"
and that seems to work ok.

Thanks for all your effort.

MikeS
 
M

MikeS

Gina,

Yes it did resolve the mulitple page issue. It still is an attachment, but
that is ok. It opens as a Word document and the formatting is perfect.
Before, when it was openning as an Excel doc it was virtually unreadable.

I am happy with what I have now and we can call this case closed. Thank you
so much for your effort and patience.

MikeS
 

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