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

AutoUpdate and auto close?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Is there any way of having a macro run every 4 hours? I am trying to have it update the tables every four hours or so, sort of an auto update. I am sure I have done this (a long time ago) before, but I can't get it to work now! Also, How do you get a form to close if there is no activity in a set time? <p>John Vogel<br><a href=mailto:john@computerwiz.net>john@computerwiz.net</a><br><a href=If you are interested in working on a very worthwhile Christian web project, please email me at<br>
volunteers@theocities.com<br>
-===================================================-<br>
-==============
 
Put your code that runs macro into form's On Timer event and set Timer Interval to 14 400 000 (milliseconds). Works as long as form is open. What kind of activity do you mean (user intervention, changes in underlying data)?<br>
<br>
Al
 
Thanks that would work for an update macro. What I mean by no activity, in the other scenario, is if the user hasn't clicked on any fields or done anything in say 1 hour, then the form will close. This prevents people from leaving and forgetting to close the form. I know I have used the code before to do this... but I have a half million things going on at work right now, and I can't think straight :) And I can't find my code snippets either :(<br>

 
You could set a global variable in your form to false as soon as it opened and then change it to true if any activity occurs (use your various On Events -- depends on what you consider to be activity). Then in your OnTimer event which you trigger to run every hour, you can check whether the variable is still false. If so, you can close the form.
 
Isn't there some kind of function to check whether ANY activity has occured, rather then having to do an event check for evey field and every button? <p>John Vogel<br><a href=mailto:john@computerwiz.net>john@computerwiz.net</a><br><a href=If you are interested in working on a very worthwhile Christian web project, please email me at<br>
volunteers@theocities.com<br>
-===================================================-<br>
-==============
 
It all depends what you consider to be activity.<br>
<br>
There's a property called &quot;dirty&quot;. This is what it says in the index for Access under &quot;dirty&quot;.<br>
<br>
You can use the Dirty property to determine whether the current record has been modified since it was last saved. For example, you may want to ask the user whether changes to a record were intended and, if not, allow the user to move to the next record without saving the changes.<br>
<br>
There are the events &quot;OnMouseMove&quot; and &quot;OnKeyDown&quot; which monitor any movement but I've never used them. Check &quot;Help&quot; for how to use these events.<br>
<br>
Rochelle
 
I think the OnMouseMove would work, if I put it in the Forms event properties. Thanks alot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top