Solved

Format a hyperlink field to send an email

Posted on 2006-11-06
3
270 Views
Last Modified: 2008-02-01
In Access 2003 I want to store email addresses in a hyperlink field.  When my users click on the field I want it to open a new outlook email.  It's currently storing the values as "http://".  How do I make it store the values as "mailto:" without users having to type that in?
0
Comment
Question by:dan_nolan
3 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17885358
Well u could not store as hyperlink
or change it at runtime

FollowHyperlink  Replace(myhyperlinkfield,"http:","mailto:")

0
 
LVL 19

Accepted Solution

by:
Eric Sherman earned 125 total points
ID: 17886123
Kind of along the same lines as rockiroads solution .... Here what I generally do.

1.) Put a little command button on your form next to the email address field (you can use the picture of the email letter rather than text).  This way you can size it down.  Call it CmdEmail

2.) For the Form's OnCurrent Event enter ....  Me.CmdEmail.HyperlinkAddress = "mailto:" & Me!YourEmailControlName

Now, when the user clicks the Email button Outlook will open with the email address already filled in.  
Just replace YourEmailControlName with your actual control name on the form.

Also, you should include this code in the email address field's AfterUpdate event.

ET
0
 
LVL 4

Expert Comment

by:HKComputer
ID: 17886716
You don't need to store it with "mailto:" if you handle it anytime the email address is used.

But if you want to spare your users from typing it in, here's what I would do. Use the email textboxes exit event.

Private Sub txtEmail_Exit()
   If Left(Nz(Me.txtEmail, ""), 7) <> "mailto:" Then Me.txtEmail = "mailto:" & Nz(Me.txtEmail, "")
End Sub


It's much the same as what etsherman posted.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question