Shell 
Author Message
 Shell

Hi I have a workbook that I use to let the user open a
database by shelling to Access, my question is after the
user closes all the form how can I close the session of
Access using code.
Frank.


Fri, 25 Nov 2005 10:03:04 GMT  
 Shell

Quote:

>Hi I have a workbook that I use to let the user open a
>database by shelling to Access, my question is after the
>user closes all the form how can I close the session of
>Access using code.

Since Excel has no way of telling when all of the forms are closed in
Access (even if you set an object reference to the Access session
rather than shelling to it [1]), I think that the best way would be to
put some code in the Form_Close events of each form in the Access
database. When the form count hits 1 (indicating that it's the last
form), then do an application.quit:

If Forms.Count = 1 Then

    Application.Quit acQuitPrompt

End If

[1] Pedantry point: If you set an object reference to Access and start
it that way, Excel should be able to query the forms count to
determine how many are open. What it CAN'T (easily or practically)
know is WHEN the last one is closed, and take the necessary action to
close Access at that time. From a practical point of view, handling
that within Access itself is the better approach IMHO.

---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *



Fri, 25 Nov 2005 10:44:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Shell, Print, Shell, Print, etc

2. Call Shell() vs. var = Shell()

3. Outlook 200 Shell Loses Track of Folder Objects

4. How can i run shell command in script editor of outlook form design

5. Netware compatible shell not available

6. Error: Netware Compatitle Shell Not Available

7. A novell-compatible shell is not available..

8. Netware Compatible Shell Unavailable

9. Netware shell dead?

10. netware compatible shell not available


 
Powered by phpBB® Forum Software © phpBB Group