Adding multiple entries between two dates

NDBadger

Registered User.
Local time
Today, 16:45
Joined
Jul 7, 2006
Messages
27
Hello everyone. I need help trying to get my head around this. I have a table which we use to track our employee's appointments. We use a form to fill in pertinent information into this table. Once filled in another form designed like a calender pops up listing each of these appointments. Our issue is this. We have to fill out this form for each day the employee is gone or they will not show up on the calender. For one day appointments this is no big deal but when the employee takes numerous days off we have to fill out a form for each day.

We would like to have a way to use this form and only have to fill in the start date and end dates and have Access copy and insert a record for each day between. Is this possible? Thanks
 
Last edited:
It wouldn't be that hard. You could use a Do/While loop and a date variable, incrementing the variable inside the loop. The loop would end when the variable exceeded the end date.
 
Sounds doable. Thanks. I will give that a try.
 
No problem; post back if you get stuck on it.
 
I am having difficulty with the date variable. I have never been good at writing codes. would you mind giving me an example? Thanks
 
At this moment I'm sitting in an airport waiting for a flight, so I don't have all my databases available. If you post what you have so far, I can fix it. Generally, you want to declare a date variable and set it to your start date. Start your loop comparing the variable to the end date, then within the loop append a record using the date variable. Add a day to the date variable and loop.
 

Users who are viewing this thread

Back
Top Bottom