Email Address in Table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Apologies for the duplicate post but I think something may be wrong with my
original post as Rick B responded to my post as follows: "OK. Do you have a
question".

So I am trying again. Here is my question:

I want a field in a table for email address. I do not want the user to have
to type mailto: I do not know how to format a field for this.

Thank you professionals...happy holidays.
 
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:
(e-mail address removed)
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.
 
Jeff,

Thanks SO much. This worked perfectly and it was way beyond what I was
trying to accomplish yet a really refreshing means of accomplishing what we
wanted to. Happy holidays!
 
You're very welcome, glad to help.
Happy holidays to you as well.
 
As Rick pointed out, you made some statements but didn't actually ask a
question.

And in this message you've done it again.

Possibly the answer to the question you haven't asked is

"You can't do this by formatting a field. Store the email address in an
ordinary text field. On a form, add a text box bound to the field. Name
the textbox txtXXX, where XXX is the name of the field. In the text
box's Click event procedure, put something like this:
Application.FollowHyperlink "mailto:" & Me.ActiveControl.Value
.."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Email Address in Table Design 1
Best Email & Web hosting 5
AOL email scam 2
Email Hyperlinks in access 1
Trying to reduce number of fields 0
Email Bounce Error 3
EMail 1
My own email & website 0

Back
Top