Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

Access 2007 Can I close Access on another user's computer in VBA?

I need to make updates from time to time in Access.   If another user has the company db open, I can't export modules to it.  Can I close the db from my workstation?  If so, how?
0
David_W_R
Asked:
David_W_R
  • 2
  • 2
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
While you can, it's not a great idea.

A better approach is to provide a shutdown feature in the app itself, either passive or forced.

Open a hidden form at startup, and set a timer for say 60 seconds.   Each time it fires, check a flag (a field in a table for example) and if that flag is found, message the user.  You can then either let them finish up (passive) or quit the app (forced).

Also check that flag at startup and if found, don't start the app, just quit.

You can do the flag with something like this:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_5328-Resource-locking-in-your-applications.html

Jim.
0
 
David_W_RAuthor Commented:
Perfect, thanks for the help, Jim.

Dave
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Dave,

 I should have added another piece that you might want to implement as part of this:

How to detect User Idle Time or Inactivity in Access 2000
http://support.microsoft.com/kb/210297

 This show you how to kick out users based on inactivity.  This in conjuction with a lock out flag gives you a good all a round solution.

 I also should have mentioned that the reason you don't want to force a user out of Access externally is that it can cause database corruption.

Jim.
0
 
David_W_RAuthor Commented:
The very issues I was addressing in my mind while contemplating the next move.   Thanks very much for the thoughtful follow-up.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now