Good Afternoon everybody
I have got a Holiday planner which I managed to find on youtube however I have amended and added a column in C whereby I record each individual holiday entitlement through each year.
when Combobox 1 is selected it shows an employee ID number on textbox 1 and entitlement on textbox 6. and then you can select the 2 dates between and it then it gives you a total number of days however what i would like to achieve is that when the days are calculated and from the combobox2 is selected as "H" it is to calculate the holiday entitlement which is in textbox 6 and the days it is selected to show whether days are within the holiday entitlement and if not it should give a message to say holiday entitlement has been used.
below it is the code where it calculates the days when two dates are selected from the calendar.
i can upload a sample book if anything makes easier
I have got a Holiday planner which I managed to find on youtube however I have amended and added a column in C whereby I record each individual holiday entitlement through each year.
when Combobox 1 is selected it shows an employee ID number on textbox 1 and entitlement on textbox 6. and then you can select the 2 dates between and it then it gives you a total number of days however what i would like to achieve is that when the days are calculated and from the combobox2 is selected as "H" it is to calculate the holiday entitlement which is in textbox 6 and the days it is selected to show whether days are within the holiday entitlement and if not it should give a message to say holiday entitlement has been used.
below it is the code where it calculates the days when two dates are selected from the calendar.
i can upload a sample book if anything makes easier
VBA Code:
Sub Calculate_Days()
Me.lbl_Days.Caption = ""
If Me.TextBox2.Value <> "" And Me.TextBox3.Value <> "" Then
If CDate(Me.TextBox3.Value) >= CDate(Me.TextBox2.Value) Then
If Me.ComboBox2.Value = "HDL" Then
Me.lbl_Days.Caption = Format((CDate(Me.TextBox3.Value) - CDate(Me.TextBox2.Value) + 1) / 2, "0.0") & " day(s)"
Else
Me.lbl_Days.Caption = Format(CDate(Me.TextBox3.Value) - CDate(Me.TextBox2.Value) + 1, "0") & " day(s)"
End If
End If
End If
End Sub