Hi Guys,

I'm creating a Project On VB6 which that keeps track of the Employees Information, Training Details, Salaries, Leave Details and the Payrol "Not Calculating the Payrol it's just Entering information". What I'm stuck in are:

1-: Since the employee has joined the organization, he / she should entitled an Annual Leave, Sick Leave. I want to caluclate the Leave that employee should have since date of Joining, substracting the days that has been taken from his Total Leave, as well as the Sick Leave.

the employee is entitled 21 days if he / she completed 4 years whilst 28 days if he / she completed 5 years.

Now, if I want to make all these calculations. Do I have to make the Formula within the Tables that has got the information? Or what is the idea to get rid of that ??

My Idea is:

This calculation is idepend on the Experaice for the employee. And I should calculate to get the Expreriance of the Employee and then Calculate how many days the emplyee entitled if he / she reaches the experiance rate.

Code:
Rs.Open "Data",Conn, .............,..............., adCmdTable
oD = DateDiff("YYYY", Now, Rs.Field("JoiningDate").Value)
oD = Rs.Field("Experiance).Value

If Rs.Field("Experiance).Value = 4 then 
RsLeave.Field("LeaveEntitled").value = 21
else
Rs.Field("LeaveEntitled).Value = 28

End IF
Rs.Close
RsLeave.Close
Is this idea is right ?? If not then what is the right thing to do. Please help as I'm a newby in the programming language.

many Thanks in advace,

habibalby