Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Send report automatically via Outlook once daily

Posted on 2004-08-24
8
Medium Priority
?
331 Views
Last Modified: 2012-06-22
I have it working when I run the macro so I just need to get the macro to run the first time access is open that day.   I dont want it to be sent each time access is opened that day, only the first time its open. Also there is a message box that pops up warning me that a program is trying to send an email on my behalf asking me if I want to proceed.  I want to keep it from asking me that because it stops the macro until I hit yes.  
0
Comment
Question by:robyergovich
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
8 Comments
 
LVL 34

Accepted Solution

by:
flavo earned 1000 total points
ID: 11887074
I dont use outlook so i cant help you with the warnings (there are serveral Q's asking that... ill look)

the other bit... im thinking add a new table called "tblSendReport" with the field "dtSent" as a date - short date

then open a new module and copy this in

Function sendReport()
'add a refrence to DAO Object Library 3.?
Dim db as dao.database
Dim rs as dao.recordset

set db = currentdb
set rs = db.openrecordset("select * from tblSendReport where dtSent = #" & Date() & "#;"
  If rs.recordcount = 0 then
     'not done yet
     docmd.runmacro "macMyMacroName"
     doevents
     db.exectue "insert into tblSendReport ( dtSent ) values ( #" & date() & "# );"
  end if

rs.close
db.close
set db = nothing
set rs = nothing

end sub


then create a macro Called "AutoExeC" then from the list on the left select "RunCode" then type this in the box down the bottom asking for a function name

sendReport()

All Done!

Dave
0
 
LVL 34

Expert Comment

by:flavo
ID: 11887094
here's a few links to look at..

If you are not confident in VBA then you're in a little trouble...

Dave

http://www.experts-exchange.com/Databases/MS_Access/Q_20266201.html
http://www.experts-exchange.com/Databases/MS_Access/Q_20911629.html
0
 
LVL 66

Assisted Solution

by:Jim Horn
Jim Horn earned 1000 total points
ID: 11887185
The message box that pops up indicates that your Exchange Administrator has applied the Outlook E-mail Security Update, which is installed to combat various email viruses, and the message is by design.  See http://support.microsoft.com/default.aspx?scid=kb;en-us;262997

You'll probably need to work with whomever runs your email system to work around this.

Good luck.
-Jim

0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

Author Comment

by:robyergovich
ID: 11933753
Dave, I followed your instructions and I think this will work but so far it doesnt do anything when I open the database.  When I run the AutoExeC macro it gives me an error message saying "user-defined type not defined".  Is this because of the note you put in about addinf a reference to the DAO library?  I dont know how to do that.  Anyway let me know if you have any ideas.  I think I follow the solution for the most part.  Also will this fix it so the macro is run when anyone opens the database or only when I open it?  
0
 

Author Comment

by:robyergovich
ID: 11933782
P.S. -  I will be out of town until Thursday so I wont get a chance to work on this again until then.  Thanks in advance for your help.
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 12166970
robyergovich  - Looks like you've received some solid advice from multiple experts.  Since this question appears to be getting old, please consider awarding points for the effort and closing it.  Thanks in advance.  -Jim
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question