Updating a Date based on Yes No Checkbox valuie

stinej

Registered User.
Local time
Today, 00:45
Joined
Feb 21, 2004
Messages
23
Hi,

I have a form that schedules client service for the week. The user uses a calendar to select the week beginning date. They then select the days of that week that services will be provided using check boxes for each of the days. Additionally, there is a check box called "recurring" that is selected if the services are ongoing.

There are a few things I want to do with this information that I'm having trouble with.

1st. I want the week beginnning date to automatically update at the beginning of the next week if the recurring box is true... something like this

if me.recurring = true then
me.weekbeginning = Date() - WeekDay(Date()) + 1
end if

However, the way I want it to work doesn't seem to fit an event procedure as the form shouldn't ever have to be opened again if the services are recurring until the service ends.

2nd. I want to use the infomation listed in that table/form to build a daily schedule of work. I'm having difficulty figuring out how to build a query that k nows that Tomorrow is Monday March 15th (for example) and should therefore select any records that have the Monday checkbox selected with March 14th as the weekbeginning fields date. I think the difficulty is really in the checkbox for the days of the week is that they need to be assigned a value based on the weekbeginnning date somewhere, I'm just not sure where.

Any help is greatly appreciated!
Thanks,
J
 
If I assume that a recurring service means the same day each week, then you could run a routine when the database is opened. Run a query that looks for recurring services where the last date in your table is before today, and then schedule another service 1 week ahead of this. You can probably wrap this up in a single query. Then, each time the databse is opened, your recurring services will be set up for the next seven days. I would have thought that running this at the start of the day would be enough?
 

Users who are viewing this thread

Back
Top Bottom