Solved

ms access concatenate email hyperlink

Posted on 2014-07-24
3
600 Views
Last Modified: 2014-07-25
I'm using the following query to concatenate email address:
INSERT INTO tblEmail ( Operator, Email )
SELECT tblAging_Email.operator_name, [tblAging_Email]![assignee_name] & '@' & 'cdc.gov' AS Email
FROM tblAging_Email;

The tblEmail email field data type is set to hyperlink. When I click on the hyperlink field (email) in the tblEmail nothing happens. When I edit the email field I noticed that text to display is in the correct format (xbn8@cdc.gov) however the mailto is blank. Also, when I enter the email address manually it works fine. Any thoughts how I can resolve this problem. Thanks
0
Comment
Question by:shieldsco
3 Comments
 
LVL 24

Accepted Solution

by:
chaau earned 500 total points
ID: 40218430
the SQL format for hyperlink column when used in SQL is:
DisplayPart#hyperlinkpart#

Open in new window

The hyperlink part must include the correct protocol. For the email addresses the protocol is "mailto:".
Therefore, you need to modify your SQL statement to this:
INSERT INTO tblEmail ( Operator, Email )
SELECT tblAging_Email.operator_name, 
[tblAging_Email]![assignee_name] & '@' & 'cdc.gov' & "#mailto:" & [tblAging_Email]![assignee_name] & '@' & 'cdc.gov' & "#" AS Email
FROM tblAging_Email;

Open in new window

0
 
LVL 84
ID: 40219155
I would avoid the Hyperlink datatype and instead just store the email address in a standard Text field. You'll find them much simpler to update and work with that way, and you can always use the FollowHyperlink method to "launch" the email address:

Application.FollowHyperlink Me.YourEmailField
0
 

Author Closing Comment

by:shieldsco
ID: 40219279
Works Good -- Thanks
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now