Access Data to Automatic Outlook Email

G

Guest

Hi,

I would like to know if the following is possible with Access 2000:

Can data from Access in Query or Report format be automatically emailed? By
automatically, I mean that no one has to manually send the email--the email
is sent at the same time every day as long as the computer is turned on.

We schedule reservations, and then send them up to the reservations desk to
be booked.

Reservation request fields are stored in an access database (date, lodging,
adults, children).

Thanks,
Diana
 
G

Guest

The rsyntax to send mail, will be using the sendObject, so you can send
reports, query, etc.

docmd.SendObject
acSendReport,"ReportName",,"(e-mail address removed)",,,"Subject","Message Text",false
' The false in the end indicate that the mail can be send without editing

docmd.SendObject
acSendQuery,"QueryName",,"(e-mail address removed)",,,"Subject","Message Text",false

Run this code when the application is open, using the Autoexec macro, and
close it after the mail is sent.
You can schedule the application to run using the windows schedular.
 
G

Guest

Thanks for the code. This is my first macro. I can get the report sent by
Outlook now, but still not sure how to use the 'Autoexec' macro. I used the
wizard to make the macro, and chose 'sendobject'. There was no choice for an
'autoexec' macro. Where is 'autoexec' located, and where is the windows
scheduler?

Diana :)
 
G

Guest

I have another question about your last post: what is the significance of
'false'? You explained it to me, but I accidentally built the Macro so that
it was "true". I did not receive a prompt to edit the macros like I
expected. So, could you explain the benefit or function of choosing "false"?

Thank you!
Diana
 
G

Guest

Hi,

When I tried your SQL statement, I got the following:

"invalid SQL statement, expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'"

Thanks,
Diana
 
G

Guest

The Autoexec it's a macro, when access load it recognize the AutoExec macro
and run it automatically, so if you want access to send email strait as it
comes up, you need to specify it there.

The False, mean that it shouldn't prompt you with the mail message, it
should send it automatically.
So event should be as folow
1. Windows schedular run an mdb file
2. The mdb opens, it recognize the Autoexec, and send the mail without
asking you to press the send button
3. After the send main command, run another one to close the mdb

Now, if you want to open the mdb without access running the Autoexec macro,
you need to hold the shift key down.
 
G

Guest

i'm talking about the following that you gave me:

docmd.SendObject
acSendReport,"ReportName",,"(e-mail address removed)",,,"Subject","Message Text",false

Haha, maybe it is not an SQL statement. I am not really sure, but I pasted
it into a 'RunSQL' macro (after editing it of course w/ proper email address
and report name) and it didn't work.

Thanks,
Diana
 
G

Guest

When you use a Docmd.RunSql Access expect an action query such as insert,
delete, edit.
To open a query that display records, you need to use Docmd.OpenQuery.
But I still can't see how it's connected to the send mail command
 
G

Guest

Hi,

Thanks for the info. I have a few questions:

1) what does 'mdb' mean?
2) still cannot find 'autoexec' macro. where is its location so I can edit
it?
3) is the Windows schedular a part of the Access software? How can I edit
the time at which different Macros run? Does the schedular enable me to do
this?

Diana
 
G

Guest

I see my error.

When I use wizard, I do not need the Docmd portion of the code you gave me.

Thanks!
 
G

Guest

Hello,

I was reading through posts trying to find how to use Access (2000 or
higher, preferably 2000 but 2007 is a possibility) to automatically generate
a form and email it automatically. For example, the Events Template has date
fields and I was hoping that while the Events Template in 2007 could hold the
data of deadlines, important events, etc., it could also send an email a
month before that date via Outlook. Is there a way this can be done? It's a
similar problem that Diana posted earlier. I was hoping you had a solution.

Silverfox
 

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