×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Sending Email From Access Form Button Click

Sending Email From Access Form Button Click

Sending Email From Access Form Button Click

(OP)
Hi I was searching for an option to send an email on a button click. I found the following code. But I am getting a compile error when I try to run the code. Please help!!

http://www.tek-tips.com/viewthread.cfm?qid=1670887

RE: Sending Email From Access Form Button Click

Did you make the Reference to the Outlook object?

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Sending Email From Access Form Button Click

Also

Dim strEmail, strBody as String

This isn't quite doing what you think it may be doing.

RE: Sending Email From Access Form Button Click

(OP)
What would be the best way to do this then? I need to send an email on button click would really appreciate some help regarding this. I have to submit my project this Saturday.

RE: Sending Email From Access Form Button Click

To shed some light on what strongm is saying, you have a statement that actually says:

Dim strEmail As Variant, strBody as String

It was corrected later on in the thread StanJx is mentioning in the OP

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Sending Email From Access Form Button Click

(OP)
I was able to get the below code working for me. But I am receiving an error message I have to allow every time I am sending an email. Any idea how to stop that message?

Dim mailto As String
Dim ccto As String
Dim bccto As String
mailto = "Test@test.com"
ccto = ""
bccto = ""
emailmsg = "Hi" & vbNewLine & vbNewLine & "Please find the report attached"
mailsub = "Monthly Sales Report"

DoCmd.SendObject acSendNoObject, Null, , mailto, ccto, bccto, mailsub, emailmsg, False

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close