You are here:

Using MS Access/Sending mails when run a query

Advertisement


Question
QUESTION: Hi Expert,


I am using Access 2013.

I have created some queries and I want to run these queries every end of day , whenever database is updated during the day.

Please guide me how it can be done.


Process is like :

if database is updated > query will run > send mail to predefined address at EOD.

Thanks

ANSWER: You can use a Timer event on a hidden form to check the current time at intervals. At End of Day you can then run the queries and send via e-mail using the SendObject method.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

---------- FOLLOW-UP ----------

QUESTION: Hi Scott,

Thanks for quick and precise answer, I can build on that from google.

I need a small clarification, I am storing my access database over shared drive , it will be used only for storing data and running some queries.

So once configured as suggested by you , how will it send mails?
i.e. from which account it will be sending mail??
So it is necessary to be present physically with outlook configured to send it over mails ?

Please suggest!!

Thanks

Answer
First, if your application is multi-user it NEEDS to be split between a back end (the tables) and a front end (everything else). The back end will be stored on a shared network drive and front end on the local user drive.

So using SendObject it would send e-mail from the logged in user.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.