Email button code

  • Thread starter Thread starter renold1958
  • Start date Start date
R

renold1958

I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help
 
I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help

Change that field's datatype to Text, not Hyperlink.

Code the Form's Control's DOUBLE-CLICK event:
Application.FollowHyperlink "Mailto:" & [ControlName]
 
renold1958 said:
I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help

This will open your default email application:

Dim strMessage As String 'Body of message
Dim strSubject as String 'Email Subject
Dim strTo as String 'To address
strTo="(e-mail address removed)"
strMessage = "Hi " & txtFirstName.Text & "," & vbCrLf & vbCrLf
strMessage = strMessage & "This is to let you know Blah, Blah, Blah"
DoCmd.SendObject acSendNoObject, , acFormatTXT, strTo, , , strSubject
, strMessage, True

-Cameron Sutherland
 

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

Back
Top