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

Calculate a date from check boxes

Status
Not open for further replies.

rkasnick

Programmer
Apr 28, 2003
66
US
Hi All. Here's a question I have not been able to get my mind around.
On a form I have a checkbox for each month (12), a checkbox for each
week (4) and a checkbox for each day (7). If a user checks Jan and
week 1 and Tues, I want to calculate the actual date for that
day(assuming the current year), and if they check July and leave the
week and day check boxes as they are I want to calculate the date from
that combination.

The check boxes can have multiples per type, meaning more than 1 month
can be selected, and more than 1 week can be selected and more than 1
day can be selected, and a loop will roll through the boxes in
month-week-day order and calculate the date for each combination and
write it to a file.

For example, if Jan and Jun are checked and week 1 and week 3 are
checked and Tues is checked the code should return the actual date for
each.


Any ideas on the best practice to accomplish this?

Thanks in advance.

Rod
 
Rod,

This may be a case where telling us what you are trying to accomplish will be helpful.

I think you are going to have an insurmountable hurdle in that your form/control design doesn't allow any way to which week/day goes with a particular month. Refering to your example: does week 1 go with Jan or June? Plus what about weeeks that break between 2 months.

Access's Calender control leaves much to be desired both from a properties and installation standpoint, but have you looked at it to see if it may be of some use in allowing the user to select dates?

Cheers
Bill
 
Hi Bill, the application for this is a schedule maker. For example, I want to schedule a service call for a customer on a recurring basis, three times a year, and I want to do it on Tuesday, the first week of the selected months, and I want to be able to visually see the whole year by month, week and day, not necessarily by date. However, I must have a date stored in the schedule file so it will be indexed properly. Some customers will be three times a year, some two times, some once and some every month. It could even be as often as every week on a Thursday.

I already make extensive use of mscal.ocx in various parts of the database for date selection, however it does not serve the purpose when attmpting to do what I propose above.

The date selection logic behind this has got me baffled. I am an experienced programmer with advanced concepts, but have not run up against this type of code before, and the customer is adamant about this functionality.

Regards
Rod
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top