Solved

Format a hyperlink field to send an email

Posted on 2006-11-06
3
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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