form timer event

shutzy

Registered User.
Local time
Today, 00:42
Joined
Sep 14, 2011
Messages
775
i have a form with a timer event. it refreshes the time txt box on the form every sec.(i have been told about other ways to do this so the question is not should it be a sec or not)

the event for the timer then is

If txtbox=09:00 then
code
code
code

the event runs at 9am. this is the time we start work. the timer is on the password log in screen, so it is the first screen to be used. it stays open when the user logs in but another form has the focus.

what i am asking is if the form no longer has the focus will the timer event still run. the only reason i am asking is that the event is to sent txt reminders to our customers for their appointments and today we had a call saying they did not get one. this is only the 2nd time it has happened. if it isnt the loss of focus then any suggestions?
 
you don't set a timer to run at a certain time, in that way. it isn't a scheduled task. within a form, you set a timer event to run at set intervals.

to do what you want you would need to write a code loop to wait until a specified time, and then run (and then no doubt set a flag to stop it running again). you then have the problem of resetting it to run the next day.

the easiest way is not to use a timer, just to run the code on startup. is that not possible?
 
sorry but i put the statement in brackets to prevent a reply like that. if it loses focus will the code run
 
You can find out yourself.
Take a look to your clock then replace the 9:00 in this code
If txtbox=09:00 then
with a new time. As example, if your clock show 17:47, put in code 17:49 then run the code, move the focus to other form and wait to see what is happen at 17:49
 
sorry - i misread your first post, and i realise you HAVE set the timer event correctly.

the problem may be that the timer doesn't fire at EXACTLY 9.00 - maybe it's 9.00 and 1/100 second.

try changing the code and testing whether the rounded time value is 9.00.
 

Users who are viewing this thread

Back
Top Bottom