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

On Timer, Interval ???

Status
Not open for further replies.

toptech

Programmer
Apr 12, 2001
71
US
Hi There.

Can someone tell me how this works.

How do I use the on timer and interval to automate my app to execute an email at a certain time of day and the week
every week.

I have a table of records that contain locations of files that I would like to email on certain day and time of the week, every week.

I have a check box for the day of the week and fields for drop down selection of hour and minute for the time of day.
I am running it based on 24 hour as opposed to 12 hour with am/pm.

I know that I can determine the day, hour, minutes and seconds, with the built in functions.

However,

I don't know how to get the program to loop and keep checking for the time.

once I hit the time, I execute a function that will send an email.(I have all this part working)

As well, I need to make sure that the Timer will only send the info for that specified time only one time for the week.

I hope all this makes sense.

The timer is the last piece of my application.

Hope someone can help me out here.

Thanks in advance.

Jeff






Top Tech Systems

If you help 3 people and each one of those help 3 other people and so on, imagine all the people being helped.
 
How are ya toptech . . .

Setup a macro named [blue]AutoExec[/blue] that runs your code (the Run Code Action). When you first open a db this macro will run. Now you simply use windows [blue]Task Scheduler[/blue] to open the Db at the proper time! In your code, open a blank form that runs a timer which allows enough time for the e-mail to be sent then finally closes the Db.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
That was definitely a pretty smart way of coming about achieving his goal.
 
Hi Aceman1.

Thanks for your feedback.

I thought about your response.
My idea was to do without windows scheduler, I currently use windows scheduler to run some of my code that will email all my selected files each day at one particuler time.

However,

The idea is to check what time each file is to be sent.
I would like to check the file to be sent time time vs the sytem time once every 60 seconds so as not to send the same file twice.

This is where I think the time interval kicks in, but I don't know how to exactly use it.


regards,

jeff




Top Tech Systems

If you help 3 people and each one of those help 3 other people and so on, imagine all the people being helped.
 
toptech . . .

are you saying you have a table of files to be sent at different times? ... and why is the time so important? I'm sure you have your reasons, I just keep wondering why a button to send them all won't due!

In any case (assuming you have the table above), in the [blue]Timer[/blue] event you'd have code that performs a [blue]DLookup[/blue] with criteria comparing time, like:
Code:
[blue]"[SendTime]>=SysTime AND [SendTime]<=SysTime+30secs"[/blue]
The time window is simply to allow the email time to be sent, as servers don't always answer contact right away.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hi Aceman1,

The files are created at different times of the day from another system, so they are not available to be sent all in one shot.


Regards,

Jeff

Top Tech Systems

If you help 3 people and each one of those help 3 other people and so on, imagine all the people being helped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top