E-mail field in an Access database

S

Scott

I see that there is an option to make a field a hyperlink, but is there a way
to make an e-mail field a mailto: link? I would like to be able to click on
an e-mail address directly from the database and have it open an e-mail.
Thanks!
 
J

Jeff Conrad

Here is a past post of mine on this issue which may help:
1. Make a field in the table called EmailAddress set as Text (not hyperlink).

2. Enter the e-mail addresses like so on the data entry form:
[email protected]
They will not have to type the "mailto" part

3. Code the double-click event of that field's control on the data entry form like so:

Private Sub EmailAddress_DblClick(Cancel As Integer)
On Error GoTo ErrorPoint

Dim strEmail As String

' Stop the Web Toolbar from appearing
DoCmd.ShowToolbar "Web", acToolbarNo

If Not IsNull(Me.EmailAddress) Then
strEmail = Me.EmailAddress
If Left(strEmail, 7) <> "mailto:" Then
strEmail = "mailto: " & strEmail
End If
Application.FollowHyperlink strEmail
End If

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

Double-clicking on that field will bring up Outlook (assuming that
is what you are using) with a new message and their e-mail address
already filled in.

Another option is here:
HOW TO: Change the Values in a Hyperlink Field from an HTTP
Address to a MAILTO Address in Microsoft Access 2000:
http://support.microsoft.com/default.aspx?scid=kb;en-us;323202
--
Jeff Conrad
Access Junkie
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
 
S

Scott

Thanks Jeff...I will check this out.
Jeff Conrad said:
Here is a past post of mine on this issue which may help:

1. Make a field in the table called EmailAddress set as Text (not hyperlink).

2. Enter the e-mail addresses like so on the data entry form:
[email protected]
They will not have to type the "mailto" part

3. Code the double-click event of that field's control on the data entry form like so:

Private Sub EmailAddress_DblClick(Cancel As Integer)
On Error GoTo ErrorPoint

Dim strEmail As String

' Stop the Web Toolbar from appearing
DoCmd.ShowToolbar "Web", acToolbarNo

If Not IsNull(Me.EmailAddress) Then
strEmail = Me.EmailAddress
If Left(strEmail, 7) <> "mailto:" Then
strEmail = "mailto: " & strEmail
End If
Application.FollowHyperlink strEmail
End If

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

Double-clicking on that field will bring up Outlook (assuming that
is what you are using) with a new message and their e-mail address
already filled in.

Another option is here:
HOW TO: Change the Values in a Hyperlink Field from an HTTP
Address to a MAILTO Address in Microsoft Access 2000:
http://support.microsoft.com/default.aspx?scid=kb;en-us;323202

--
Jeff Conrad
Access Junkie
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
 
Top