Try this:
Private Sub cmdEmail_Click()
Dim strMail As String
strMail = "#MailTo:" & Me.txtEMail & "#"
Application.FollowHyperlink HyperlinkPart(strMail, acAddress)
End Sub
The above uses a plain text field and textbox (txtEmail) to mail from an
email address in the database. Three advantages:
1. Your problem is solved
2. Larger file size of hyperlinks is eclipsed
3. Less chance of corruption
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
"Freehal04"
news:DC75A6E0-4A9A-4274-BB24-BDB6F01AC2A0@microsoft.com...
> So I tried to fix my hyperlink field for my email so it would add the
> 'mailto:' in front of what a user types in. Here's what I have.
>
> Private Sub Email_AfterUpdate()
> ' If you just type in an email name: Somebody@hotmail.com
> ' Access changes it to: Somebody@hotmail.com#http://somebody@hotmail.com#
> !!
> ' This code tries to fix it
> Dim intI As Integer
> ' Don't do anything if email is empty
> If IsNull(Me.PMemailAddress) Then Exit Sub
> ' Fix up http:// if it's there
> Me.PMemailAddress = Replace(Me.PMemailAddress, "http://", "mailto:")
> ' Now look for the first"#" that delimits the hyperlink display name
> intI = InStr(Me.PMemailAddress, "#")
> ' And put the person name there instead if found
> If intI > 0 Then
> Me.PMemailAddress = (Me.PMemailAddress + " ") & Me.LastName & _
> Mid(Me.PMemailAddress, intI)
> End If
> End Sub
>
> When I try to type something in I get a compile error "Method or data
> member
> not found. and it highlights the line before the End if,
> Mid(Me.PMemailAddress,intI)
>
> I don't get it. What's wrong.