UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Automatically Generate Daily Excel Report, Access 2013    
 
   
wantj43
post Jul 10 2018, 02:51 PM
Post#1



Posts: 45
Joined: 8-May 13
From: Fairbanks Alaska


Is it possible create a button on a form to generate a daily report of records entered that day; then generate an excel spread sheet; then email that report to a specific recipient?
Any help truly appreciated.
Joe
Go to the top of the page
 
MadPiet
post Jul 10 2018, 02:57 PM
Post#2



Posts: 2,506
Joined: 27-February 09



probably create a query that gets the data you want using [DateField] = DATE() and then use SendObject to send the file.
Go to the top of the page
 
GroverParkGeorge
post Jul 10 2018, 04:26 PM
Post#3


UA Admin
Posts: 33,780
Joined: 20-June 02
From: Newcastle, WA


Yes, this can be done.

Re: automatically

Do you want to start this as a manual process under your control and let the rest be done automatically?

Or, do you want this to happen even if no one is logged on to the computer at the time?

Go to the top of the page
 
wantj43
post Jul 10 2018, 07:44 PM
Post#4



Posts: 45
Joined: 8-May 13
From: Fairbanks Alaska


I would like to manually initial the process at the end of each day.
Thank you
Joe
Go to the top of the page
 
GroverParkGeorge
post Jul 11 2018, 08:57 AM
Post#5


UA Admin
Posts: 33,780
Joined: 20-June 02
From: Newcastle, WA


Okay, then. So here are the steps.


I'd probably do this with two separate Functions. One to generate the Excel report and the other to then send it to the recipient. Put code behind your command button to run the first function, then the second.

Create a query that selects the appropriate data, as Pieter explained.

Export the contents of that query into an Excel file. I would recommend you do this by creating a template in Excel that you can instantiate for this purpose. Depending on the number of records involved, you may want to use the CopyFromRecordset method; it's more efficient for larger recordsets.

That will get you to the goal of an Excel report.

The other part of the process is to email the report to one specific recipient. You can use any one of a handful of options to do this, of course. One important consideration is which email client you use. Outlook? Something else?

Go to the top of the page
 
wantj43
post Jul 11 2018, 07:39 PM
Post#6



Posts: 45
Joined: 8-May 13
From: Fairbanks Alaska


Thanking everyone.
This really helps.
Joe
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    20th October 2018 - 09:51 AM