How should emails be entered

F

Frankie Deschacht

What is the best way to enter email addresses in a field?
As plain text, as Hyperlink or as Hyperlink which starts with "mailto:"?
I want to know especially how to do it if you intend to send emails
regularly to the people in your database.

Thanks,
Frankie.
 
C

Cheryl Fischer

Personally, I think it is easier just to enter the email address in a
standard Text Box, simply because Access presumes that values entered into a
Hyperlink field are for web-site access and it is a pain to edit the
Hyperlink to make it a "mailto:".

In your text box containing the email address, you do not particularly need
to enter the "mailto:", and you can format the email address using a Blue
fore color and make it underscored so that it looks like a Hyperlink. Then,
in the Double Click event of that text box, you could insert the following
code:

Dim strEmail as String

strEmail = "mailto:" & Me.
Application.FollowHyperlink Address:=strEmail

Substitute your actual field name for EMail in the above code.

hth,
 
J

Jim/Chris

I got this from Fred yesterday

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.

--
Fred

Good Luck

Jim
 
F

Frankie Deschacht

Thanks for your help so far, everyone.
However, I am not sure I understand when you start talking about "The double
click feature".
I tried double clicking in a field and nothing happened.

Cheers,
Frankie.
 
C

Cheryl Fischer

Frankie,

Something will happen only if there is some code in the DblClick event. If
you are unfamiliar with creating event procedures, here's how:

In your form's design view, right-click on the text box containing the email
address, then select Properties from the pop-up menu. In the properties
sheet for that text box, find the DblClick event and click anywhere on that
line. You will see a downward pointing arrow at the right edge of the line.
Click it and select Event Procedure. Then, look for the small button to the
right of the downward pointing arrow which contains an ellipsis (three dots
....). Click this button to open the code window for the Dbl Click event.

When the code window is first opened, it will look like this:

Private Sub Email_DblClick(Cancel As Integer)

End Sub

You will want to insert the following lines after the "Private Sub
Email_DblClick(Cancel as Integer)" line

Dim strEmail as String

strEmail = "mailto:" & Me.
Application.FollowHyperlink Address:=strEmail

Save and close the code window; save your form and return it to form view.
Double click on your text box email value and you should be fine.

Post back if you need further info.
 

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