into a live mailto link?

  • Thread starter Thread starter joe thompson
  • Start date Start date
J

joe thompson

What is the easiest way of turning an email field in an
access form into a live mailto link?

Thanks

Joe
 
Set the onClick event on the form to run the shell command
mailto:[email protected]

shell ("explorer mailto:[email protected]")

The other option is to have a hyperlink on your form that does the job..
Access allows hyperlinks... labels have a property called hyperlink address
where you could fill in the mailto link at runtime.

hope that helps.
 
Thanks Kailash

The problem I have is that (e-mail address removed) is not static
each form record has a different entery based on the
batabase. I need some way to say

On click > mailto: [email field value]

Regards

Joe
 
A simple bit of code will work in a text field called Email in a textbox
with the name txtEmail:

Private Sub txtEmailAddress_DblClick(Cancel As Integer)
Dim strMail As String

strMail = "#MailTo:" & Me.txtEmailAddress & "#"
Application.FollowHyperlink HyperlinkPart(strMail, acAddress)

End Sub

Add some error handling and you're done.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

joe Thompson said:
Thanks Kailash

The problem I have is that (e-mail address removed) is not static
each form record has a different entery based on the
batabase. I need some way to say

On click > mailto: [email field value]

Regards

Joe
-----Original Message-----
Set the onClick event on the form to run the shell command
mailto:[email protected]

shell ("explorer mailto:[email protected]")

The other option is to have a hyperlink on your form that does the job..
Access allows hyperlinks... labels have a property called hyperlink address
where you could fill in the mailto link at runtime.

hope that helps.

--
Kailash Kalyani
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC




.
 
I got this from Fred and it works great

You do not need to use the hyperlink datatype to send an
email to the address. Use a regular Text DataType instead.

Code the Double-click event of the form control that shows
the field:

Application.FollowHyperlink "Mailto:" & [ControlName]

Making corrections to the text field is much easier than
editing a
hyperlink field.

Jim
 
Back
Top