I am working on a Time Sheet (r_TimeSheet). If an employee has overtime (time and a half), I want it to print the Overtime total (OTTotal), and any extra regular hours. I have that working fine. The problem is when you come up with Negative overtime. Then I want it to NOT print the Negative number. I created another field (OtherRegluar2) and have it totaling the Negative number and RegularHours.
When I print the Time Sheet, I want it to, if positive overtime, to print the Overtime total and Regular Hours. If Overtime is Negative, I want it to hide the Overtime Total and Regular Hours and show OtherRegular2. I have the below code working if it's Negative, It hides OTTotal and RegularHours. But when OTTOtal is a positive number, It does not hide anything. In the below code, the first half seems to work but the second half (after Else) does NOT. Does anyone see anything wrong with this code?
If OTTotal < 0 Then
Report_r_TimeSheet.OTTotal.Visible = False
Report_r_TimeSheet.RegularHours.Visible = False
Report_r_TimeSheet.OtherRegular2.Visible = True
Else
If OTTotal > 0 Then
Report_r_TimeSheet.OtherRegular2.Visible = False
Report_r_TimeSheet.OTTotal.Visible = True
Report_r_TimeSheet.RegularHours.Visible = True
End If
Thomas Bailey
a/k/a TomCat
When I print the Time Sheet, I want it to, if positive overtime, to print the Overtime total and Regular Hours. If Overtime is Negative, I want it to hide the Overtime Total and Regular Hours and show OtherRegular2. I have the below code working if it's Negative, It hides OTTotal and RegularHours. But when OTTOtal is a positive number, It does not hide anything. In the below code, the first half seems to work but the second half (after Else) does NOT. Does anyone see anything wrong with this code?
If OTTotal < 0 Then
Report_r_TimeSheet.OTTotal.Visible = False
Report_r_TimeSheet.RegularHours.Visible = False
Report_r_TimeSheet.OtherRegular2.Visible = True
Else
If OTTotal > 0 Then
Report_r_TimeSheet.OtherRegular2.Visible = False
Report_r_TimeSheet.OTTotal.Visible = True
Report_r_TimeSheet.RegularHours.Visible = True
End If
Thomas Bailey
a/k/a TomCat