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

Ask me again in 5 minutes....... 1

Status
Not open for further replies.

Danyul

Technical User
Jul 5, 2001
36
AU
Another Timer issue!

Hi Guys,

I have a form that pops up with the 'Autoexec' macro that has various VBA code mdules behind it. One of the controls allows the user to put in a number and then hit the 'Ask me again in <input> minutes...' button.

At the moment this run on a loop using the 'dateadd' function (as suggested in a previous thread). It works OK but its a bit messy as Access is constantly running the loop in the background and won't fo anything else.

Is there a way of having Access setting itself an 'alarm call' (sort of) and automatically reloading the form after the specified time?

Any help greatly appreciated.

Regards,

Danyul
 
Use the timer interval Property on the Form.

On your Buttons code write the line

------------------------
me.Timerinterval = 10000
------------------------

This sets the time to 10 secs. (Timerinterval is in millisecs).

You then need to put the name of the function or routine you wish to run after that time in the OnTimer event of the form.

-------------------------
=TimerFinish()
-------------------------

This will allow you to do anything you wish during the time as long as the form is still open.

Hope this works

Ian
 
I would set the TimerInterval property of the form equal to the answer the user gives * 60000, that way it is not triggering unnecessarily.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top