B
BruceM
I have an employment summary form for keeping a record of employee
employment history. I have a main form based on the Employees table and a
subform based on a query, which is in turn based on a Details table that
stores Employer, StartDate, and EndDate. The Details query contains a
calculated field (using DateDiff) for the amount of time elapsed between
StartDate and EndDate. The Details subform contains a text box in the
footer for adding up the total years in the calculated fields for all
related records:
Employer 1 2/1/03 1/15/04
MyCompany 2/1/04 (Current Date)
If it matters, the DateDiff calculation determines the number of months.
The TotalYears text box in the footer divides the sum by 12 and rounds up to
a whole year. It works as intended. The modification I would like to make
is that if the employer is the current company (MyCompany) I would like
EndDate to be the current date unless the employee no longer works here, in
which case I would like to lock in the date the employee left. There is an
Inactive field (Yes/No) in the Employees table. This last step (locking in
the end date) doesn't need to be automated, although it would be good if it
was. It would be OK to just have a message box pop up when Inactive is
checked, directing the user to take some action to lock in the end date.
I can get the subform record to show the current date as I would like by
using the Current event for the subform, but it updates only when I click
into the subform record that lists MyCompany as the employer. I need to
have the total updated automatically when the user looks at the employee's
employment summary record.
employment history. I have a main form based on the Employees table and a
subform based on a query, which is in turn based on a Details table that
stores Employer, StartDate, and EndDate. The Details query contains a
calculated field (using DateDiff) for the amount of time elapsed between
StartDate and EndDate. The Details subform contains a text box in the
footer for adding up the total years in the calculated fields for all
related records:
Employer 1 2/1/03 1/15/04
MyCompany 2/1/04 (Current Date)
If it matters, the DateDiff calculation determines the number of months.
The TotalYears text box in the footer divides the sum by 12 and rounds up to
a whole year. It works as intended. The modification I would like to make
is that if the employer is the current company (MyCompany) I would like
EndDate to be the current date unless the employee no longer works here, in
which case I would like to lock in the date the employee left. There is an
Inactive field (Yes/No) in the Employees table. This last step (locking in
the end date) doesn't need to be automated, although it would be good if it
was. It would be OK to just have a message box pop up when Inactive is
checked, directing the user to take some action to lock in the end date.
I can get the subform record to show the current date as I would like by
using the Current event for the subform, but it updates only when I click
into the subform record that lists MyCompany as the employer. I need to
have the total updated automatically when the user looks at the employee's
employment summary record.