M
Mike
I have a sub form setup to calculate a workers pay.
Depending on what job he is doing, he could be payed by
the pieces he produces, by the hours he works or by his
average hourly wage. I thought that this code would work,
but it didn't. Can some one point me in the right
direction please?
Private Sub Pay_AfterUpdate()
Dim PieceRate As Integer
Dim HourlyRate As Integer
Dim AverageRate As Integer
PieceRate = [COMPANY_NO] >= "02" And [COMPANY_NO] <= "79"
HourlyRate = [COMPANY_NO] >= "C1" And [COMPANY_NO] <= "M9"
AverageRate = [COMPANY_NO] = "01"
If [COMPANY_NO] = PieceRate Then
[Pay] = [Pieces] * [Rate]
If [COMPANY_NO] = HourlyRate Then
[Pay] = [WageBase] * [Hours]
If [COMPANY_NO] = AverageRate Then
[Pay] = [AverageWage] * [Hours]
End If
End Sub
Depending on what job he is doing, he could be payed by
the pieces he produces, by the hours he works or by his
average hourly wage. I thought that this code would work,
but it didn't. Can some one point me in the right
direction please?
Private Sub Pay_AfterUpdate()
Dim PieceRate As Integer
Dim HourlyRate As Integer
Dim AverageRate As Integer
PieceRate = [COMPANY_NO] >= "02" And [COMPANY_NO] <= "79"
HourlyRate = [COMPANY_NO] >= "C1" And [COMPANY_NO] <= "M9"
AverageRate = [COMPANY_NO] = "01"
If [COMPANY_NO] = PieceRate Then
[Pay] = [Pieces] * [Rate]
If [COMPANY_NO] = HourlyRate Then
[Pay] = [WageBase] * [Hours]
If [COMPANY_NO] = AverageRate Then
[Pay] = [AverageWage] * [Hours]
End If
End Sub