emailing from a email address in a field in a form

  • Thread starter Thread starter Phil J
  • Start date Start date
P

Phil J

Hi all I would like to design a field where I could enter a clients
email address which would allow me to click on that email address and
start Outlook.
I've tried a hyperlink field, but that starts IE.

Any suggestions?

Thanks in advance

Phil
 
Phil,

In the textbox's AfterUpdate event, add code to prepend "mailto:" to the
email address (don't include the quotes, though).

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Hi Graham.
I did that,
This is what I typed in, in the after event
mailto: to the email address

Access gives me a error message saying not macro of that name.

Do I need to make a macro?

Ta

Phil
 
Phil,

What you need to have in the AfterUpdate event is this (assuming your
control is called txtEmail):
Private Sub txtEmail_AfterUpdate()
Dim sAddr As String

sAddr = Trim(Me!txtEmail)

If Len(Trim(sAddr)) > 0 Then
If Left(sAddr, 7) = "mailto:" Then
sAddr = Left(sAddr, InStr(1, sAddr, "#") - 1)
sAddr = sAddr & "#" & sAddr & "#"
Me!txtEmail = sAddr
End If
End If
End Sub

You also need to be sure that the data is being stored in a Hyperlink field,
and that the control's IsHyperlink property is set to Yes.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 

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

Back
Top