open a form at a certain time

F

fishqqq

I have a form that has a "time" field set to a numeric value. The user
inputs a value in this field that is actually a "minute" value that is
required by the user for the program to trigger a reminder form to
open. ie. they set the value to 15 if they want to be reminded in 15
minutes etc. Once this setting is made the program updates another
field with the start time ,which is now(). So the user is basically
saying 15 min from now remind me to do something by opening another
form.

What i am having difficulty with is the timer function. How do i get
the program to look at the time field and compare it to the now()
setting and open the form i want when the 15 mins have past???

I know calendar has a reminder / tasks feature but for various reasons
i need something directly tied to access.

any help would be greatly appreciated.

Tks
STeve
 
P

PieterLinden via AccessMonster.com

I have a form that has a "time" field set to a numeric value. The user
inputs a value in this field that is actually a "minute" value that is
required by the user for the program to trigger a reminder form to
open. ie. they set the value to 15 if they want to be reminded in 15
minutes etc. Once this setting is made the program updates another
field with the start time ,which is now(). So the user is basically
saying 15 min from now remind me to do something by opening another
form.

What i am having difficulty with is the timer function. How do i get
the program to look at the time field and compare it to the now()
setting and open the form i want when the 15 mins have past???

I know calendar has a reminder / tasks feature but for various reasons
i need something directly tied to access.

any help would be greatly appreciated.

Tks
STeve

You need to use the OnTimer event of another form. There you check for time
elapsed using DateDiff and then open your second form. the values are in
milliseconds, so you could do something at like 60,000 (once per minute).
 
V

vincent

I had a similar problem. I would solve it this way:

1. declare a Public variable named 'datNow' in a module
2. on the 'on click' event of the button to start the timer fill this
variable with 'now()' and put the form's Timer property to 60000 which means
: check every minute
3. In the 'in timer' event pu codet: if Minutes(now() - datNow) >= 15 then
DoCmd.Openform "xxx", which means: if the difference between now and the
start time (contained in variable datNow) is bigger or equal to 15,
expressed in minutes, then open form xxx
4. do not forget to put the Timer property back to 0 fter opening the form

Hope this is a bit usefull to you
Good luck

Vincent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top