Solved

Format a hyperlink field to send an email

Posted on 2006-11-06
3
287 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

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

737 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