Given a three text boxes containing:last event date/time, a current date/time, and a next time (no date) what is the easiest way to calculate the next event date for the following scenarios: 1) Next event date if there are seven day of the week check boxes (multiple checkboxes can be checked.) 2) Next event date on the day n of every x months. This uses the nth day of the month, and can skip every x months. N can be any legal calendar day number from 1-31. 3) The Next event date on the of every x months. Ive already included a simple framework to illustrate what we are trying to do. All that is needed is two functions (see code). Note: The Next event date/time can never be less than the current date/time. This is because the next event is always in the future. Example: if today is Feb 5, 2003 in the first scenario with Mon and Tue checked and a time of 3:00PM. The next event date/time should read as the Feb the 10th 3:00PM. After the Current date/time equals the Next event time (02/10 at 3:00PM), then the last event time becomes Feb 10, 3:00PM and the next event time should read Feb 11th at 3:00PM. This is a internal scheduler for an application which sleeps and executes an event based on it watching the timer. For example, currently if today is Feb 6,2002 and the time is 1:00:00PM, with the Thursday box checked and the event time set to 1:05:00PM, then the correct next event time should be 2/6/2003 1:05:00PM. The current time continues to increment 1:01PM, 1:02PM…etc until the current time reaches 2/6/2003 1:05:00. At this point two things should occur. The event should be triggered (which is simple debug statement now) and the scheduler should then update the next event time to read 02/13/2003 1:05:00PM. So you see, the next event time is never less than the current time, and the timer continues on. The whole point of this component is for unattended operation on a server. We have an event that needs to be triggered over time. The end user can set the interval, and ensure that this happens. Another example is lets say that a report needs to be sent every friday at 3:00PM. This scheduler triggers the report generator at that time.
1) complete source code for three scenario functions. 2) Complete ownership and distribution copyrights to all work purchased.
Visual Basic 6.0