Create an E-Mail field on a form

G

Guest

How can I set up a field on a form to accept E-mail addresses. It should
work like a hyperlink only it must run my e-mail program (Outlook) when I
click on the field (containing e-mail address). I know the link should
begin with Mailto: but I cannot get this to work. Any idea?

I want the users to type in a different e-mail for each record on this form.
 
D

Damon Heron

Are you using MS smarttags? That seems to work okay. Just use an ordinary
textbox.
"urn:schemas-microsoft-com:blush:ffice:smarttags#PersonName"

I use a doubleclick to send the email :

Private Sub txtEmail_DblClick(Cancel As Integer)
Dim strEmail As String
strEmail = "mailto:" & Me.[txtEmail]
Application.FollowHyperlink Address:=strEmail
End Sub

HTH
Damon
 
F

fredg

How can I set up a field on a form to accept E-mail addresses. It should
work like a hyperlink only it must run my e-mail program (Outlook) when I
click on the field (containing e-mail address). I know the link should
begin with Mailto: but I cannot get this to work. Any idea?

I want the users to type in a different e-mail for each record on this form.

The easiest way for the user is to simply have a regular text datatype
field for the user to enter the email address into.
This way, the data can easily be edited without the user inadvertently
sending an email.

Then, to have the user send an email to that person, code the
control's double-click event (or code a command button click event):
Application.FollowHyperlink "Mailto:" & [TextControlName]
 
G

Guest

Thank you. I'll try both suggestions. Damon, What are smarttags? Tell me
more? Is this part of Access? Or some other program?
--
FL


Damon Heron said:
Are you using MS smarttags? That seems to work okay. Just use an ordinary
textbox.
"urn:schemas-microsoft-com:blush:ffice:smarttags#PersonName"

I use a doubleclick to send the email :

Private Sub txtEmail_DblClick(Cancel As Integer)
Dim strEmail As String
strEmail = "mailto:" & Me.[txtEmail]
Application.FollowHyperlink Address:=strEmail
End Sub

HTH
Damon

FL said:
How can I set up a field on a form to accept E-mail addresses. It should
work like a hyperlink only it must run my e-mail program (Outlook) when I
click on the field (containing e-mail address). I know the link should
begin with Mailto: but I cannot get this to work. Any idea?

I want the users to type in a different e-mail for each record on this
form.
 
D

Damon Heron

Access 2003.
Go to Tools, Options, Forms/Reports. Click Show SmartTags on Forms.

Damon


FL said:
Thank you. I'll try both suggestions. Damon, What are smarttags? Tell
me
more? Is this part of Access? Or some other program?
--
FL


Damon Heron said:
Are you using MS smarttags? That seems to work okay. Just use an
ordinary
textbox.
"urn:schemas-microsoft-com:blush:ffice:smarttags#PersonName"

I use a doubleclick to send the email :

Private Sub txtEmail_DblClick(Cancel As Integer)
Dim strEmail As String
strEmail = "mailto:" & Me.[txtEmail]
Application.FollowHyperlink Address:=strEmail
End Sub

HTH
Damon

FL said:
How can I set up a field on a form to accept E-mail addresses. It
should
work like a hyperlink only it must run my e-mail program (Outlook) when
I
click on the field (containing e-mail address). I know the link
should
begin with Mailto: but I cannot get this to work. Any idea?

I want the users to type in a different e-mail for each record on this
form.
 
G

Guest

I'm using MSAccess 2000. Forget about smart tags for a minute. The
original double click event procedure instructions does not work. I created
exactly as you specified. I get compile error.
--
FL


Damon Heron said:
Access 2003.
Go to Tools, Options, Forms/Reports. Click Show SmartTags on Forms.

Damon


FL said:
Thank you. I'll try both suggestions. Damon, What are smarttags? Tell
me
more? Is this part of Access? Or some other program?
--
FL


Damon Heron said:
Are you using MS smarttags? That seems to work okay. Just use an
ordinary
textbox.
"urn:schemas-microsoft-com:blush:ffice:smarttags#PersonName"

I use a doubleclick to send the email :

Private Sub txtEmail_DblClick(Cancel As Integer)
Dim strEmail As String
strEmail = "mailto:" & Me.[txtEmail]
Application.FollowHyperlink Address:=strEmail
End Sub

HTH
Damon

How can I set up a field on a form to accept E-mail addresses. It
should
work like a hyperlink only it must run my e-mail program (Outlook) when
I
click on the field (containing e-mail address). I know the link
should
begin with Mailto: but I cannot get this to work. Any idea?

I want the users to type in a different e-mail for each record on this
form.
 
D

Damon Heron

Is your textbox named the same as the example? Where is the code stopping?

Damon


FL said:
I'm using MSAccess 2000. Forget about smart tags for a minute. The
original double click event procedure instructions does not work. I
created
exactly as you specified. I get compile error.
--
FL


Damon Heron said:
Access 2003.
Go to Tools, Options, Forms/Reports. Click Show SmartTags on Forms.

Damon


FL said:
Thank you. I'll try both suggestions. Damon, What are smarttags?
Tell
me
more? Is this part of Access? Or some other program?
--
FL


:

Are you using MS smarttags? That seems to work okay. Just use an
ordinary
textbox.
"urn:schemas-microsoft-com:blush:ffice:smarttags#PersonName"

I use a doubleclick to send the email :

Private Sub txtEmail_DblClick(Cancel As Integer)
Dim strEmail As String
strEmail = "mailto:" & Me.[txtEmail]
Application.FollowHyperlink Address:=strEmail
End Sub

HTH
Damon

How can I set up a field on a form to accept E-mail addresses. It
should
work like a hyperlink only it must run my e-mail program (Outlook)
when
I
click on the field (containing e-mail address). I know the link
should
begin with Mailto: but I cannot get this to work. Any idea?

I want the users to type in a different e-mail for each record on
this
form.
 
G

Guest

In Access 2003, all you need to do is put a button next to the email field.
In the button's click event, set the button's HyperLinkAddress property.

btnEmail.HyperlinkAddress = "mailto:" & myEmailField

The email will start automatically using the default email client.

Not sure if you have this property in A2K from memory...

Note: You should check there is an email address entered and that it is
valid before setting the button's property...

Steve
 

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