S
Sabosis
Hello-
I have a report with three fields that I need to do an if...then type
statement on and am having trouble. The report should ultimately
direct me as to whether an employee needs to move to the next step in
our corrective action process. The fields I have are as follows:
CorrLevelID
TotalOccurences
UnpaidTime
NextStep
I am trying to write something that will look at the CorrLevelID
( level of corrective action, 1-5) then look to see how many
attendance occurences and unpaid time a representative has
accumulated. I will ultimately need to write several if/then/else
statements together as I will need to evaluate different corrective
levels which will each have unique combinations of total occurences &
unpaid time. Below is the code that I have started with...
Public Function NextLevelCode()
Dim CorrLevelID As Integer
Dim UnpaidTime As Integer
Dim TotalOccurances As Integer
Dim NextLevel As String
If ([CorrLevelID] = 1 And ([TotalOccurances] >= 6 Or [UnpaidTime] >=
16) Or ([TotalOccurances] >= 4 And [UnpaidTime] >= 8)) Then
NextLevel = "Y"
Else
NextLevel = ""
End If
End Function
On the report, I have the Next Step control source set to
=NextLevelCode().
Nothing is happening when I run the report.
I have a report with three fields that I need to do an if...then type
statement on and am having trouble. The report should ultimately
direct me as to whether an employee needs to move to the next step in
our corrective action process. The fields I have are as follows:
CorrLevelID
TotalOccurences
UnpaidTime
NextStep
I am trying to write something that will look at the CorrLevelID
( level of corrective action, 1-5) then look to see how many
attendance occurences and unpaid time a representative has
accumulated. I will ultimately need to write several if/then/else
statements together as I will need to evaluate different corrective
levels which will each have unique combinations of total occurences &
unpaid time. Below is the code that I have started with...
Public Function NextLevelCode()
Dim CorrLevelID As Integer
Dim UnpaidTime As Integer
Dim TotalOccurances As Integer
Dim NextLevel As String
If ([CorrLevelID] = 1 And ([TotalOccurances] >= 6 Or [UnpaidTime] >=
16) Or ([TotalOccurances] >= 4 And [UnpaidTime] >= 8)) Then
NextLevel = "Y"
Else
NextLevel = ""
End If
End Function
On the report, I have the Next Step control source set to
=NextLevelCode().
Nothing is happening when I run the report.