Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Email From Access 2000

Status
Not open for further replies.

glove

Technical User
Aug 24, 2000
42
US
When I use the following code to email a report from Access:

DoCmd.SendObject acReport, sEmailObject, "RichTextFormat(*.rtf)", sEmailAddress, "", "", sEmailSubject, sEmailMessage, False, ""

I get the following error if the value of "sMailMessage" is greater than 20 characters:

MSACCESS caused an invalid page fault in
module KERNEL32.DLL at 0157:bff78769.

Any ideas?

[sig][/sig]
 
I supose you just had a typo cause the error variable does not match the code
'sEmailMessage'
the value of "sMailMessage" missing 'E'

What is in 'sEmailMessage'? Can you Debug.Print it out before you execute the DoCmd.SendObject?

Also crazy errors in Access is time to reboot the PC.
[sig]<p>DougP, MCP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.[/sig]
 
Yes DougP, the missing &quot;E&quot; was just a typo.

Here is an example of what is in sEmailMessage when I get the error:

&quot;this is a test to see if Access gives me an error when I try to send an email.&quot;

Here is an example of what is in sEmailMessage when I don't get the error:

&quot;dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd&quot;

I was only getting the error when sMailMessage contained over 20 characters, now it seems to be random.
It usually sends the email no matter if I get the error or not. But, the error causes Access to crash. Microsoft has something on them web site about an error similar to this which says that the error may be related to damaged cache files or folders. I've tried their resolution, but it doesn't work. And rebooting doesn't solve the problem either.
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top