Email button code Problem See 11/5/ fredg

J

JoanOC

Confused.
I typed the code as instructed.
What is [ControlName]?
I was able to create a commond button to access Outlook Express BUT not from
the property of the email field on the form.
Look forward to reply.
Thank you.
Joan
 
F

fredg

Confused.
I typed the code as instructed.
What is [ControlName]?
I was able to create a commond button to access Outlook Express BUT not from
the property of the email field on the form.
Look forward to reply.
Thank you.
Joan

Joan,
I'm confused also.
It is customary, when responding in a newsgroup, to keep the response
within the same thread. This permits all readers to read the previous
posts and to follow along. Others may then respond to your question
and, and as a result, you get your answer much quicker, as well as
everyone getting a chance to learn from your message.

If I hadn't seen my name in the subject line, I would not have made
sense of this message. Even so, I had to take time to look up the
previous message.

To any other reader trying to make sense of this, here is the previous
question and my response (I think, as the From: address is not the
same as the current From: address and there is no name associated with
the original message):
I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help

The first thing to do is to change the table field's datatype to Text.

Then open the Form in design view.
While I suggested the control's double-click event,
if you wish to use a command button simply code the command button
click event:

Application.FollowHyperlink "Mailto:" & [ControlName]

I don't know what that control's name is, so where I use the generic
[ControlName] you substitute your actual form's control name (the
control that displays the address of the person you wish to email to).

You do not need any other code.
Whichever program is your default email program will be the one that
opens, with the address already entered of address shown on the
current form.

Hopefully, I've answered the correct message. If you do have a
follow-up question, please keep it in this thread.
 
J

JoanOC

Appreciate your feedback and instructions about how to use this site.
The following is what I have entered in an attempt to open up my ISP with
the e-mail address on my form:
Application.FollowHyperlink "MailTo" & [D_Attny Email]
I recieve an error message: Run Time Error 490.
I still do not understand the control name: is it the control source?
If so, that is the name if the e-mail field on my form that I typed.
Help. Thanks in advance.
Joan

fredg said:
Confused.
I typed the code as instructed.
What is [ControlName]?
I was able to create a commond button to access Outlook Express BUT not from
the property of the email field on the form.
Look forward to reply.
Thank you.
Joan

Joan,
I'm confused also.
It is customary, when responding in a newsgroup, to keep the response
within the same thread. This permits all readers to read the previous
posts and to follow along. Others may then respond to your question
and, and as a result, you get your answer much quicker, as well as
everyone getting a chance to learn from your message.

If I hadn't seen my name in the subject line, I would not have made
sense of this message. Even so, I had to take time to look up the
previous message.

To any other reader trying to make sense of this, here is the previous
question and my response (I think, as the From: address is not the
same as the current From: address and there is no name associated with
the original message):
I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help

The first thing to do is to change the table field's datatype to Text.

Then open the Form in design view.
While I suggested the control's double-click event,
if you wish to use a command button simply code the command button
click event:

Application.FollowHyperlink "Mailto:" & [ControlName]

I don't know what that control's name is, so where I use the generic
[ControlName] you substitute your actual form's control name (the
control that displays the address of the person you wish to email to).

You do not need any other code.
Whichever program is your default email program will be the one that
opens, with the address already entered of address shown on the
current form.

Hopefully, I've answered the correct message. If you do have a
follow-up question, please keep it in this thread.
 
F

fredg

Appreciate your feedback and instructions about how to use this site.
The following is what I have entered in an attempt to open up my ISP with
the e-mail address on my form:
Application.FollowHyperlink "MailTo" & [D_Attny Email]
I recieve an error message: Run Time Error 490.
I still do not understand the control name: is it the control source?
If so, that is the name if the e-mail field on my form that I typed.
Help. Thanks in advance.
Joan

fredg said:
Confused.
I typed the code as instructed.
What is [ControlName]?
I was able to create a commond button to access Outlook Express BUT not from
the property of the email field on the form.
Look forward to reply.
Thank you.
Joan

Joan,
I'm confused also.
It is customary, when responding in a newsgroup, to keep the response
within the same thread. This permits all readers to read the previous
posts and to follow along. Others may then respond to your question
and, and as a result, you get your answer much quicker, as well as
everyone getting a chance to learn from your message.

If I hadn't seen my name in the subject line, I would not have made
sense of this message. Even so, I had to take time to look up the
previous message.

To any other reader trying to make sense of this, here is the previous
question and my response (I think, as the From: address is not the
same as the current From: address and there is no name associated with
the original message):
I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help

The first thing to do is to change the table field's datatype to Text.

Then open the Form in design view.
While I suggested the control's double-click event,
if you wish to use a command button simply code the command button
click event:

Application.FollowHyperlink "Mailto:" & [ControlName]

I don't know what that control's name is, so where I use the generic
[ControlName] you substitute your actual form's control name (the
control that displays the address of the person you wish to email to).

You do not need any other code.
Whichever program is your default email program will be the one that
opens, with the address already entered of address shown on the
current form.

Hopefully, I've answered the correct message. If you do have a
follow-up question, please keep it in this thread.
Off-hand, I don't know what error 490 is.
Perhaps there was also a written error description.

To answer your question....
[D_Attny Email] may, or may not be, the name of the control.
If you added the control to the form using the Field List tool button,
Access will assign the field name to the control name (so the control
source and the control name are the same). That is fine and will not
cause a problem here.

If you added the control to the form using the text tool button found
in the tool box, then Access assigns, by default, a name such as
Text1, Text2, etc.

In any event, it is the control's name you need to use, not the Field
name (control source). You can check by displaying the control's
property sheet. Click on the Other tab. The control name is the first
property on that tab.
If the Control Name is, for example, "Text2", then the code is
Application.FollowHyperlink "Mailto:" & [Text2]
If the name is [D_Attny Email], then you have written the code
correctly.

By the way, this doesn't open your ISP, this opens your default email
program with the new email already addressed. If you are using Outlook
Express, sending this email will place it in the OE outbox. If you are
not already on-line, you won't actually go on-line until you then hit
Send/Receive from OutlookExpress.

Keep going, you're almost there.
 
J

JoanOC

A million thanks for your patience. I did it. The problem was I failed to
enter an underscore between Attny and Email in the Control Name.
Question: Which is a better option: a command button or clicking on the
field on the form. This will be used by attorneys who are fairly new to
using computers. My goal is to make Access as user friendly as possible.
Again, thank you so much.
fredg said:
Appreciate your feedback and instructions about how to use this site.
The following is what I have entered in an attempt to open up my ISP with
the e-mail address on my form:
Application.FollowHyperlink "MailTo" & [D_Attny Email]
I recieve an error message: Run Time Error 490.
I still do not understand the control name: is it the control source?
If so, that is the name if the e-mail field on my form that I typed.
Help. Thanks in advance.
Joan

fredg said:
On Fri, 5 Nov 2004 12:13:03 -0800, JoanOC wrote:

Confused.
I typed the code as instructed.
What is [ControlName]?
I was able to create a commond button to access Outlook Express BUT not from
the property of the email field on the form.
Look forward to reply.
Thank you.
Joan

Joan,
I'm confused also.
It is customary, when responding in a newsgroup, to keep the response
within the same thread. This permits all readers to read the previous
posts and to follow along. Others may then respond to your question
and, and as a result, you get your answer much quicker, as well as
everyone getting a chance to learn from your message.

If I hadn't seen my name in the subject line, I would not have made
sense of this message. Even so, I had to take time to look up the
previous message.

To any other reader trying to make sense of this, here is the previous
question and my response (I think, as the From: address is not the
same as the current From: address and there is no name associated with
the original message):

I have a database containing an email field. A form has
been created with this field in it. I have set properties
for this field to hyperlink.

I like to add a button to this form with ..Email..

What is the OnClick code for this button, so that when I
click on it, Outlook Express opens automatically with the
corresponding email address in the to:

Much obliged for any help

The first thing to do is to change the table field's datatype to Text.

Then open the Form in design view.
While I suggested the control's double-click event,
if you wish to use a command button simply code the command button
click event:

Application.FollowHyperlink "Mailto:" & [ControlName]

I don't know what that control's name is, so where I use the generic
[ControlName] you substitute your actual form's control name (the
control that displays the address of the person you wish to email to).

You do not need any other code.
Whichever program is your default email program will be the one that
opens, with the address already entered of address shown on the
current form.

Hopefully, I've answered the correct message. If you do have a
follow-up question, please keep it in this thread.
Off-hand, I don't know what error 490 is.
Perhaps there was also a written error description.

To answer your question....
[D_Attny Email] may, or may not be, the name of the control.
If you added the control to the form using the Field List tool button,
Access will assign the field name to the control name (so the control
source and the control name are the same). That is fine and will not
cause a problem here.

If you added the control to the form using the text tool button found
in the tool box, then Access assigns, by default, a name such as
Text1, Text2, etc.

In any event, it is the control's name you need to use, not the Field
name (control source). You can check by displaying the control's
property sheet. Click on the Other tab. The control name is the first
property on that tab.
If the Control Name is, for example, "Text2", then the code is
Application.FollowHyperlink "Mailto:" & [Text2]
If the name is [D_Attny Email], then you have written the code
correctly.

By the way, this doesn't open your ISP, this opens your default email
program with the new email already addressed. If you are using Outlook
Express, sending this email will place it in the OE outbox. If you are
not already on-line, you won't actually go on-line until you then hit
Send/Receive from OutlookExpress.

Keep going, you're almost there.
 
F

fredg

A million thanks for your patience. I did it. The problem was I failed to
enter an underscore between Attny and Email in the Control Name.
Question: Which is a better option: a command button or clicking on the
field on the form. This will be used by attorneys who are fairly new to
using computers. My goal is to make Access as user friendly as possible.
Again, thank you so much.

** snipped ***

I'm glad you got it going.

For me, double-clicking (not clicking) is simplest , as it doesn't
clutter up the form with an extra control, but if you have
inexperienced users (who probably don't care to spend too much time
learning how to use Access), a Command Button with it's caption saying
"Click me to send this guy an email" might be best. :)
 
J

JoanOC

I agree. Another question if you can bare it.
Is it possible to make a screen name part of the code?
I run a business out of my home with one screen name I use for business, the
other for personal use.
I noticed that the mailto went to whichever screen name I last used.
(Re the attorneys I think they may only have one screen name so I should be
all set with them.)
Thank you.
 
T

troyb

Fred,

I've read these posts and for the life of me can't get this procedure to
work in my database on a button. I've copied & pasted
"application.followhyperlink "Mailto:"&" and I get a message saying
that "Application macro has not yet been saved." Do I have to create a macro
first. It seems like the "Click" properties always look for a saved Macro.

Troy
 
B

Bob

Troy
Just so you know, you are not alone, i get exactly the same problem. Please
help Fred!
Bob

troyb said:
Fred,

I've read these posts and for the life of me can't get this procedure to
work in my database on a button. I've copied & pasted
"application.followhyperlink "Mailto:"&" and I get a message saying
that "Application macro has not yet been saved." Do I have to create a macro
first. It seems like the "Click" properties always look for a saved Macro.

Troy

[QUOTE="fredg"]
** snipped ***

I'm glad you got it going.

For me, double-clicking (not clicking) is simplest , as it doesn't
clutter up the form with an extra control, but if you have
inexperienced users (who probably don't care to spend too much time
learning how to use Access), a Command Button with it's caption saying
"Click me to send this guy an email" might be best. :)[/QUOTE][/QUOTE]
 
D

Debra

THANK YOU, Fred!

I have been looking for this solution for over a month...I never knew the
answer would be so easy.
 
Top