Email Addresses (1 Viewer)

W

welshgirl

Guest
Hi,

I am a very new user to Access so please forgive me for this probably very basic question:

I have an email field in one of my forms and I want to enter the email address and at some time in the future when I want to send an email to this contact I want to click on the email address and launch a new email message.

I have carried out the following (info picked up from various help sites):

Opened form in design view - highlighted email field and opened properties - opened event tab - moved to "on click" and opened "code builder" then in VBA I have added the line:

Application.FollowHyperlink "Mailto:" & [ControlName]

between:

Private Sub Email_DblClick(Cancel As Integer) and
End Sub

When I then try to dbl click on the email address I get the following error message:

Runtime error '2465'
Microsoft Access can't find the field '|' referred to in your expression.

Thanks in advance :confused: :confused: :confused: :confused: :confused:
 

CJBIRKIN

Drink!
Local time
Today, 04:14
Joined
May 10, 2002
Messages
256
Hi,

Shot in the dark here but is this correct i.e exactly what you have written;

Application.FollowHyperlink "Mailto:" & [ControlName]

i would suggest that [ControlName] is the name of the control i.e

Me.TXT_EMAIL_ADDRESS. for a text box on the current form (you can use Me.) called TXT_EMAIL_ADDRESS


Chris

welshgirl said:
Hi,

I am a very new user to Access so please forgive me for this probably very basic question:

I have an email field in one of my forms and I want to enter the email address and at some time in the future when I want to send an email to this contact I want to click on the email address and launch a new email message.

I have carried out the following (info picked up from various help sites):

Opened form in design view - highlighted email field and opened properties - opened event tab - moved to "on click" and opened "code builder" then in VBA I have added the line:

Application.FollowHyperlink "Mailto:" & [ControlName]

between:

Private Sub Email_DblClick(Cancel As Integer) and
End Sub

When I then try to dbl click on the email address I get the following error message:

Runtime error '2465'
Microsoft Access can't find the field '|' referred to in your expression.

Thanks in advance :confused: :confused: :confused: :confused: :confused:
 

dcx693

Registered User.
Local time
Yesterday, 23:14
Joined
Apr 30, 2003
Messages
3,265
In this piece of code:
Code:
Application.FollowHyperlink "Mailto:" & [ControlName]
you need to replace the inside of [ControlName] with the name of your actual control. I think this is what CJBIRKIN was saying, but I wasn't sure. :D

If the control holding the e-mail address is called EmailAddress, then the code needs to be:
Code:
Application.FollowHyperlink "Mailto:" & Me.[EmailAddress]

If you're not sure what the control is named, open the form in design view, double-click the control holding the e-mail address, in the floating Property sheet click on the Other tab, and check the "Name".
 

Users who are viewing this thread

Top Bottom