Hi
You don't really need to add lots of code to send e mails to anyone in your
DB provideing you set it up correctly.
In you table you should have a field formated as Hyperlink.
You place the email address i this field
BUT
The hyperlink is a "MailTo" NOT a html
So insert e mail address like this
Mailto:
[email protected]
Mailto:
[email protected]
etc
etc.
If you have a control on a form with this field as it's source - just click
it to send the e mail.
Or
Put a button on the form and use something like
DoCmd.SendObject acReport, "ReportName", "RichTextFormat(*.rtf)",
Forms!FormName!ControlName, Forms!FormName!ControlNameCC, "", "EMail Header
entered here", "EMail text enter here", False, ""
Notes
Forms!FormName!ControlNameCC
We send a copy of all reports to our accounts office. Delete this section
if you don't need a CC
EMail Header entered here
This is a short string that is put into the Subject line of the e mail (We
use "weekly report of ........)
EMail text enter here
This is a short string that is put into the Details section of the e mail
(we use "If there are any problems with this mail please contact .....)
False
This section of the code is use to say if the e mail is opened in outlook
before it sends (to edit). We use False as they are just attached reports.
Put True if you want to edit the mail prior to sending.
To automate sending the e mail
You could set up windows sceduler to run a macro as at time
So you could start access, open a form, send an email, etc.
Or
Assumeing your database in turned on then try this
We use it all the time at work to send weekly report to clients at 1 minute
past 10am Monday - Oh - there are other methods of automating e mails this is
just one of them (we use it as the admin manager likes this one)
Create a marco with a condidtion something like If the time is XXX and if
today is a monday etc etc
You don't really need the above condition but it helps in case someone
forgets to send the mails
The macro opens a form.
On the form is a list of e mails that we send reports to.
OnOpen of the form the code is run.
Dead simple
Oh I have used a macro instead of VBA to open the form so the admin manager
can change the time of the report sending without going into the VBA (which I
don't want them messing about with)
Just a point if you are using Outlook then you will have a security warnign
saying a programme is trying to send an e mail - you "can" get round this by
send the mail direct to the mail server (don't use outlook) BUT BUT BUT I
would suggest you don't. Just pressing the enter key a few times is MUCH
better than the chance of losing clients after send a virus. So live with
the warning - it's one of mircosoft's better ideas.
Good luck