Help in access issue - calculated field for Leave system (1 Viewer)

Eugene-LS

Registered User.
Local time
Today, 18:31
Joined
Dec 7, 2018
Messages
481
i want to know where i should put this code: in the form or in the query ?? to make it works automatically when i work
Copy the function into any external module (not a form module), then you can use it along with other functions in forms, queries and reports.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:31
Joined
May 7, 2009
Messages
19,245
about your "Remaining Leave Balance", if i got it correctly, each employee is entitled 30 days Annual Leave each year, correct.
let say an employee only take 20 days on 2021, what will happen to the remaining 10 days this year, 2022.
Will it get forfeited? or will it be added to 30 days (30 + 10 = 40 annual leave days) to this year's annual leave?
 

mike60smart

Registered User.
Local time
Today, 16:31
Joined
Aug 6, 2017
Messages
1,905
thanks for your reply,

about first question its 30 days per year but also i want to make calculation for that regarding "Joining Date"
Like example the contract started 01-Jan-2020 the contract ends 31-DEC-2023 that means if there is employee joined 01-Jan-2023 it automatically calculated in Balance Record "30" and the next record show "from 1st Year"

if another employee joined 01-Jul-2021 it calculated automatically "15" and the next record show "from 2nd Year"

the problem is how to make this place updated not to be added new record. and only type "Annual" is required for calculation fridays and holidays.
If Employee joins Contract in 1st Year Leave entitlement is 30 days
If Employee joins Contract in 2nd Year Entitlement is 15 days
what entitlement does an employee get for 3rd and 4th Years ??

This looks a bit odd to me.
 

Eugene-LS

Registered User.
Local time
Today, 18:31
Joined
Dec 7, 2018
Messages
481
want to know where i should put this code: in the form or in the query ?? to make it works automatically when i work
See to Query " frmLeave_SubForm_Details" as example:
SQL:
SELECT [Leave Dates].*,
    GetDaysEFH([Start_Date],[End_Date]) AS DaysEFH,
    [Days]-GetDaysEFH([Start_Date],[End_Date]) AS EFH_Difference
FROM [Leave Dates];

Try change some dates ([Start_Date] and [End_Date]) in query ...
 

Attachments

  • Contract Employees Query Example.zip
    27.5 KB · Views: 79

Gasman

Enthusiastic Amateur
Local time
Today, 16:31
Joined
Sep 21, 2011
Messages
14,306
If Employee joins Contract in 1st Year Leave entitlement is 30 days
If Employee joins Contract in 2nd Year Entitlement is 15 days
what entitlement does an employee get for 3rd and 4th Years ??

This looks a bit odd to me.
I read that as just 15 days as they joined in July?, hence half the leave entitlement?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:31
Joined
May 7, 2009
Messages
19,245
you may also try this.
 

Attachments

  • Contract Employees.accdb
    2.4 MB · Views: 110

Users who are viewing this thread

Top Bottom