Putting totals in a text box

robert693

Registered User.
Local time
Today, 23:35
Joined
Mar 22, 2001
Messages
38
I have a database that tracks employee leave days. An employee can take either a full leave day or a half leave day. Each employee has 20 days of leave total that they can use each year starting on the anniversary of the date they were hired. Those that have worked more than five years get 25. At the end of the year the total rolls back over regardless of how many days were used. The reason for the leave must be entered into the database as well. I have an employee table and a day table for the dates the employees takes off. These are joined by employee number. I have created a query that gives full days the value of 1 and each half day the value of .5. I have a form based on the employee table with a subform based on the day table. In this form, I would like to have a text box that shows the number of days used by each employee during the current year and one that will show the number of days the employee has left as well. I currently have a text box that shows the number of days total the employee gets based on the years the employee has worked for the company. I am a beginner programmer and any help with this would be greatly appreciated.
 
Set the ControlSource of the text box to:

=DSum(expr, domain, criteria)

Consult the online help for specifiying the arguments for DSum - expr will probably be the field containing 1 or .5, domain will probably be a table or query including that field, and criteria will be an expression to limit the operation to the correct employee and time period.
 
Thank you, I got it to work after a few times!
 

Users who are viewing this thread

Back
Top Bottom