Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Open/Close for automated reporting but not close on user

Status
Not open for further replies.

chanman525

IS-IT--Management
Oct 7, 2003
169
0
0
US
I have a database that is actively used everyday and I have added code to send me a report from it that will be based on a day interval and a windows scheduler task to open the database, send me the report and then close.

Everything for the reporting works as intended when the sub is called and records last date ran so that it wont run everytime it is opened but should they open it and the interval to run has been exceeded then it will go ahead and run in the back ground.I want to keep it all contained in the same database however users use it everyday so I am looking for a way to setup the database so that I can call it from a scheduled task to open and send me the report and then close however not interfere with the users that open and close it everyday.

Hopefully this is more clear than a snow blizzard and I appreciate your time to help me out.


 
Have you tried to use the /X command line switch of msaccess.exe in your scheduled task?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV, thank you for the quick response. I did not think of that and so I setup it up in a short cut but it is not triggering the macro?? I can run the macro from access and it works as expected but just not firing from the shortcut (used for testing right now). Does it matter that there is already a form opening when the database opens?

shortcut path:
Target - C:\Users\user\Desktop\DCOAssets.mdb /X SendReport

Start in: C:\Users\user\Desktop

{"user" substituted for actual username}

Not sure that it matters, running WIN7 with Office 2010 and trust centers are valid.
 
PHV, That got it, sorry about missing the detail of qualifying it on the executable and not the database.

Thanks for the time and help.
 
Well, I am still having issues here, changed the flag to come from the access executable however it will not kick off my sub?

This does not work from the /x flag or running in the macro but I can step through it and it works?

Public Function CheckIt()
Call DoISend
End Function

This works fine, from command line and running macro?

Public Function CheckIt()
msgbox "Hello"
End Function

Dont understand why it will not call the sub?
 
Arrgghh, calling off the knowledge hounds due to personal stupidity. Code was working as intended.... I forgot to reset the run date so it knew not to run... Once I moved the date beyond the interval specified all took off.

Stupidity is tough to deal with however when it is self inflicted, well ouch.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top