Rocky Smolin
rockysmolin at bchacc.com
Wed Nov 17 10:45:49 CST 2010
Rusty: Please see my reply to JC. That would be the easiest but for some reason the text after /cmd doesn't show up. I'm using C:\Clients\E-Z-MRP23\E-Z-MRP_Autorun_Calcs.mdb /cmd xyz and MsgBox "*" & Command() & "*" in the Open event shows only **. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rusty Hammond Sent: Wednesday, November 17, 2010 8:16 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Solution in search of a problem and a problem insearchofa solution Rocky, Take a look at the /cmd command line option for Access. Whatever you put in after the /cmd you can read in code using the Command() function. You can send a command line parameter from the scheduler that can be read by your app. Something like: c:\PathToMDB\my.mdb /cmd Scheduler Then in your startup code do: If Command()="Scheduler" Then do something End if HTH Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, November 17, 2010 9:56 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Solution in search of a problem and a problem in searchofa solution -----Original Message----- From: dba-ot-bounces at databaseadvisors.com [mailto:dba-ot-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, November 17, 2010 7:41 AM To: 'Off Topic' Subject: [dba-OT] Solution in search of a problem and a problem in search ofa solution Dear List: I am instructing my client to use the windows task scheduler to give them the ability to run a couple of long calculations overnight. The program that will be run is a stripped down version of my manufacturing software which will run the cost roll-up and MRP calculations. I call it Autorun_Calcs. Solution to a problem: When I tried to schedule it I got an access denied error from the scheduler wizard; hotfix on the Microsoft site was for pre-SP3 and wasn't needed. Another thread however, suggested that the administrator user needed a password. I don't put passwords on my admin user account because it's just me here and the PW is a PITA. So I added a password to the admin account, set the password in the scheduled task and viola! it ran. Problem looking for solution: The app supports multiple back ends. So the user needs to be able to change back end in Autorun_Calcs to point to the back end that they want to run the calcs on. So when the program starts it needs to know if the user wants to NOT run the calcs but go to the utility menu where they can relink to a different back end. Is there some clever trick by which the program can 'know' if it was started by the user or by the task scheduler? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com