Run another application after Access exit

Pavel69

New member
Local time
Today, 09:24
Joined
Oct 6, 2006
Messages
9
I need run another application after Access exit. Another application must start just after Access exit, but not before!

Any ideas?

THANKS
 
build and execute a windows script that will wait until all instances of MSAccess are ended before executing the secondary application.
 
Better way?

Bodisathva said:
build and execute a windows script that will wait until all instances of MSAccess are ended before executing the secondary application.

Thanks, it is one possibility, but I prefere "for user invisible" solution something like "asynchronous shell". Somewhere inside API it must exists, because many install programs use this feature...
 
Pavel69 said:
Thanks, it is one possibility, but I prefere "for user invisible" solution something like "asynchronous shell". Somewhere inside API it must exists, because many install programs use this feature...
essentially, that's what you get. You build the VB script file using VBA, on the fly, and execute the file. wscript.exe is invisible to the user, unless they're watching the program manager. The script itself, if you build it correctly, terminates after executing the secondary program. You could spawn the script on open or just prior to close and have the same results.

You may, of course, do as you wish...I just wanted to be a bit more clear on my suggestion.
 
Bodisathva said:
You build the VB script file using VBA, on the fly, and execute the file...

THANKS, it sounds like VERY good advise.
I never use Windows Scripting, but I will study fast.

First, could you suggest me some start points links (except microsoft.com, I just see)?

Second, what you mean "on the fly"? As I understand for Windows Scripting must script files (VBS, JS) exist too or is there some way to pass script commands to wscript.exe most dynamicly, via DDE or something else?
 
If you're only interested in running something when the specific instance of Access is closed, you can put a hidden form that opens when the database opens and in the UNLOAD event of that form put a shell command that opens the program you want. That is probably the easiest method, but only if you are interested in the instance that the user is currently in.

Now in order to make it so that they would not be able to just close the database and leave Access running, you would need to put the quit command in the unload event too. So, if they closed your database, it would close Access and open the other program.
 
Far be it from me to disagree with bob, but in this case, you specified that the secondary application activate after Access exits and not before...that will not be possible if you activate it from the On_Close event of a form. As Access closes, it first closes all open objects, then the db, then exits the application itself, so we could be looking at an issue of semantics, but I assumed that you meant after the msaccess.exe process ended.

I have several modules that use the File System Object to write the script files I need, then I execute the scripts using the Windows Scripting Host command line (wscript.exe [flags] [path]). It sounds overdone, but there's no noticeable lag time in creation and execution and it allows me access to parts of the system that Access is less than helpful with.
 
Bodisathva said:
...you meant after the msaccess.exe process ended...

YES, I agree, this is exactly what I need!:)
Please could you publish here an example how detect process ending via Windows Scripting Host?

Thanks
 

Users who are viewing this thread

Back
Top Bottom