Unanswered: Make multiple records based on occurance
I am making a database that has to do with Preventive maintenance. Everything is going good and I came to a problem. There are recurring events. Some are weekly monthly quarterly etc all the way to 5 years. When I put in the task and a start date and he occurrence I want to create multiple records up to a certain time frame say for the next 5 years. What would be a way to do that??
Well, if you are not familiar with VBA, you may have to change that and start reading.
Very roughly in a form of pseudo-code I would consider doing something like:
For aDate = StartDate to aDate <= EndDate
If (aDate is acceptable) then
SQLInsert Event with aDate
aDate=aDate + RecuringStep
For each aDate, yo would have to check if it is ok. Like is week end acceptable? Is there a conflict with another scheduled maintenance activity?
Also you may want to tag somehow that recuring activity so that if a change must be made, it can be apply to some or all of the activities previously recorded.