I have a report that tracks employees total hours. I have textboxes Hr1, Hr2, Hr3....that connect to the "Hours Worked" database. Then I added Over1, Over2, Over3...as textboxes onto the report (they have no control source) What I wanted to do was say, if Hr1 (hours worked 1) is greater than 8 hours, than the value of Hr1 would be 8 and the value of Over1 would be the difference. For example, an employee worked 10 hours one day. Hr1 = 8; Over1 = 2. Here is my code and i'm getting errors. I put it on my report under the "On Open" event. Thanks
Private Sub Report_Open(Cancel As Integer)
If Hr1.value > 8 Then
Hr1.value = 8
Over1.Value = 2
Else
Hr1.value = Hr1.value
End If
End Sub
Private Sub Report_Open(Cancel As Integer)
If Hr1.value > 8 Then
Hr1.value = 8
Over1.Value = 2
Else
Hr1.value = Hr1.value
End If
End Sub