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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Approach 9.5 Close Script 1

Status
Not open for further replies.

TheOnlyBoxy

Technical User
Jul 5, 2004
8
0
0
GB
I would like a script to run if my opproach database is not used for a specified amount of time, ( the script will close approach without saving) this is to ensure that the database is not left open as automated tasks run over night. any help would be very greatfull. Thankx
 
There is a "TimerInterval" property you can set to any value you want. For example, you could set it in a SwitchTo event for a form view switch that occurs via a macro named OPEN when your APR is opened:

' Set the timer interval for the current view to 15 seconds.
CurrentApplication.ActiveView.TimerInterval = 15000

When the TimerInterval expires, the "UserTimer" event is raised for the same view you started it on, so you can put code in that event to check for activity and either close or simply reinitialize the timer.

The main problem with this technique is determining whether the user is still active. So most people who use this technique simply check the current time and if it is after say 8PM, they close the APR. Another method if the interval is set to something like 20 minutes so as to not annoy the user is to pop up a dialog with a message asking the user if they want to continue and give them a couple of minutes to respond. If they do not, close the APR.

Sue Sloan
XpertSS.com
 
Thank you for replying to may question, about the close .apr after or at a certian time, I have tried this but cannot get it to work, i am quite a novice with approach. would you be able to give me an example of approach closing at a certian time, in script. it would be very much appreciated. thanks Jamie.
 
Sorry sue I have now managed to get the .apr file to close after a period of time, but i cant figure out how to get it to close at a specific time or if the active view has been idle for X amount of time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top