473,378 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to automate a query and send it via email at a regular time?

It's been a few years since I've built anything in Access 03, so I'm a little rusty.

I've built a simple database to be used by employees and what I'm looking to do is make it as idiot proof as possible. The basic thought behind building this is to replace the need for hand written purchase orders and move everything to computers.

I've made a query that shows all transactions they've made during the day. Now what I'd like to do is have that query be e-mailed to me daily. It would be nice if it could be set up that every day at 6pm it automatically sends the file, but don't know if thats an option. My other thought would be to write a command within the "CLOSE" command that will email the file and close access with one button.

Any information will be useful. Thank you.
Jan 25 '11 #1
1 1265
jimatqsi
1,271 Expert 1GB
Of course you want to email the output from the query, not the query itself. So that begs the question, in what format, an Excel sheet or PDF, text or what. I do a lot of pdf emails each night, which required a significant upfront setup, but works very nicely. If that's what you want I could give you all you need to know.

For the scheduling, it depends if you want to scheduled within the app because you know the app is running, or if you need to launch the app and force it to do the task before closing the app. I use the latter method.

I use Windows Task schedule to schedule a batch file that looks like this
"C:\Program Files (x86)\Microsoft Office\OFFICE12\msaccess.exe" c:\sm\specialty.mdb /cmd NightlyRun
then in the code I look for the passed command string to take the required actions
If command() = "NightlyRun" Then

Hope that helps.

Jim
Jan 27 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Eric | last post by:
I upgraded my server from Redhat 7.3 to Redhat 9. Now all my programs that send email through PHP do not work. Do I need to set something else somewhere? I have Redhat 9, Apache 2.0.40 and PHP...
1
by: Jay McGrath | last post by:
Help - trying to send a simple text email with with as little user intervention. I am trying to create a button in my Access application that will automatically send a simple text email. It...
4
by: Colin Kingston | last post by:
Hi For a college project I intend to produce a web based access database which will allow a group leader to send the same email to group members registered for that group. I want the group...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
2
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The...
3
by: sentiboy | last post by:
I am using the following code for sending email through mapi in VS 2005 environment: Public objSession As New MSMAPI.MAPISession Public objMessage As New MSMAPI.MAPIMessages ...
3
by: Dave | last post by:
I am trying to write code to help me send an email. I have the email address to sent to, stored in a database. I've read several articles and I'm not sure what is meant by placing "yourmailserver"...
5
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
14
by: Warren Tang | last post by:
Hi I am using the mail function to send a mail like this: $b = mail("my_real_email_address@gmail.com", "Hello from PHP", "Hi, finally sent an email successfully"); But it failed. Could you...
1
beacon
by: beacon | last post by:
Hi everybody, I'm sure that everyone cringes when they see "email" in the subject for posts in the forum, but I'm hoping that what I'm trying to do is different enough to present a challenge...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.