Schedule email with report attachment

G

Guest

I currently use macro SendObject to send an email with an attachment to the
same person every month. This is sent on the 10th of each month.
Is there any way I can make this automatically send on the 10th of the month.
 
S

Smartin

MarcoR said:
I currently use macro SendObject to send an email with an attachment to the
same person every month. This is sent on the 10th of each month.
Is there any way I can make this automatically send on the 10th of the month.

Create a little VBA routine that checks to see if today is the 10th. If
so, invoke your macro. Place the code where it is guaranteed to fire
when the database opens (e.g., a form_open event).

Aah, but what if the DB is not opened on the 10th? And what if it is
opened twice on the 10th? You can kill both of these birds by recording
when a report is emailed to a table. Modify your code to check whether
it is the 10th (or later) of the current month but no table entry for
this month exists. Then email only if appropriate.

Another way might be to set up a scheduled task in Windows to invoke the
macro on every 10th. I haven't had any luck with this in a corporate
environment though. YMMV.
 

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

Top