Email from form, button error

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

Guest

Hi there,

I'm very new at this, and am having a problem with a button on a form to
send an email to the address listed on the record.

The OnClick event code is as follows:
DoCmd.SendObject acSendNoObject, , , Me.Email

I keep getting an error that states "The command or action SendObject isn't
available now."

I'm not sure what I'm doing wrong. I've also tried inserting a hyperlink
using the "mailto:" command, but don't know how to autopopulate the "To:"
area.

Either one of these will work, and any advice is GREATLY appreciated.

Thanks!
 
Hi Tim

There is a very simple method that you may want to try.
All you need to do it to store the hyperlink in a field and then (on your
form) click it and it will open the outlook message to that person.
OK it's not "quite" as simple as that - but almost. You need to store the
link in the right way for it to all work smoothly.

* Open you "table" that holds the data the form is based on (not the query
- but the table itself).
* In design view add a new field (I say add a new field as if you simply
change an old one you may lose all the data in the field - so use a new one).
* Format it from the dropdown list as a “hyperlinkâ€
* Save the table
* Open it in table view
* Now this is where you need to get the link right

If you simply put something like
(e-mail address removed) this is what you will see

BUT access actually “stores†(even if you can’t see it)
[email protected]#http://[email protected]#

To get round this you need to type this
MailTo: (e-mail address removed)

Next close the table and bring the new field into the query the form is
based on

If you are not basing your form on a query but directly from the table go
and sit in a small dark room and have a dam good talk with yourself and
convince yourself that you should not base a form on a table – but rather you
should use a query.

Next bring the new field into your form. Use view - available fields.

When you click it will open outlook with the address in the right place.

Top Tip – simple cheat – create a small rectangle (or small square) on your
form. Color it green (or whatever). Select you e mail address field and
color this green also. Put the new box over the e mail address field and
send to the back. Now when you click the nice looking box this will act as
the button for the hyperlink.

Have fun
 
After searching all morning and finding a lot of messages about codes
(SendObject) and macros (which I know nothing about), I finally found Wayne's
answer (below) on how to send e-mails to individual contacts in our Contact
Management database (which I created based on a sample CM database I
downloaded from Microsoft.) It works great!! However, I already have over
900 email addresses in my EmailAddress field (we have over 1600 records, but
many are missing this data). Is there an easy way to add "MailTo:" in front
of the ones already in the database?

Also, the Contacts form allows users to add a new contact. How can I have
the words "MailTo:" in the box on the form where they enter the client's
email address (and possibly permanently there, so they can't delete it but
have to type in the e-mail address after it)?

Thanks for your help,
Trish
 
Back
Top