I am using windows 2000pro with access 2000.
I am trying to make a database for our HR department, that would allow our HR Director to type in an employee's ID number into a form and then select the dates the employee took off from work.
(I have the calander add-in 8.0 setup to easily select the dates already) There are two Date Fields, "Leave Date", and "Return Date" where the calander selections are stored. They are in the 12/25/2006 Format.
There then is a combo box field for the "Type of Absence" the employee took. Options such as "Paid Time Off", "Unpaid Absence", "Paid Vacation",and "Volunteer Hours" are the choices in the combo box.
The HR Director asked if I could have the "Return Date" field value, subtracted from the "Leave Date" field value. Thus giving me the total number of days taken off.
So, Step 1 would be to have the dates subtracted from on another
Step 2. Is to have the total number of days taken off, broke down into hours.
Step3. Depends on wether or not "Paid Vacation" is selected for the "Type of Absence field". Because Paid Vacation is saved up, I plan to make another table for those hours to be manually stored in.
Step 4 will Idealy subtract the hours the employee has taken off from the stored vacation hours. That is all assuming that Paid Vacation is selected.
If "Unpaid Absence" or "Volunteer hours" is selected, they just need totaled up in a table.
Hopein you got all that, my main question, is;
What steps will it take codewise to make my Form subtract the two calendar dates from one another? i.e. "Leave Date" = 12/20/2006 and "Return Date" = 12/23/2006. Subtracting them, should give me 3 days off. Not sure how to start that one.
From there, I have the program down in theory...3 days * 8 hrs a day, so 24 hours which is then subtracted from the X amount of hours stored in the employee's Paid Vacation field.
I am just learning VBA and I am still just a bit uneasy with things. Input is greatly appreciated.
I am trying to make a database for our HR department, that would allow our HR Director to type in an employee's ID number into a form and then select the dates the employee took off from work.
(I have the calander add-in 8.0 setup to easily select the dates already) There are two Date Fields, "Leave Date", and "Return Date" where the calander selections are stored. They are in the 12/25/2006 Format.
There then is a combo box field for the "Type of Absence" the employee took. Options such as "Paid Time Off", "Unpaid Absence", "Paid Vacation",and "Volunteer Hours" are the choices in the combo box.
The HR Director asked if I could have the "Return Date" field value, subtracted from the "Leave Date" field value. Thus giving me the total number of days taken off.
So, Step 1 would be to have the dates subtracted from on another
Step 2. Is to have the total number of days taken off, broke down into hours.
Step3. Depends on wether or not "Paid Vacation" is selected for the "Type of Absence field". Because Paid Vacation is saved up, I plan to make another table for those hours to be manually stored in.
Step 4 will Idealy subtract the hours the employee has taken off from the stored vacation hours. That is all assuming that Paid Vacation is selected.
If "Unpaid Absence" or "Volunteer hours" is selected, they just need totaled up in a table.
Hopein you got all that, my main question, is;
What steps will it take codewise to make my Form subtract the two calendar dates from one another? i.e. "Leave Date" = 12/20/2006 and "Return Date" = 12/23/2006. Subtracting them, should give me 3 days off. Not sure how to start that one.
From there, I have the program down in theory...3 days * 8 hrs a day, so 24 hours which is then subtracted from the X amount of hours stored in the employee's Paid Vacation field.
I am just learning VBA and I am still just a bit uneasy with things. Input is greatly appreciated.
Comment