I have built a list of departments(departmentList). I wish to see if the string from field ‘dept1’ is contained within this list … I have tried the following, but first condition is always False, even although I know the string is contained here, since I print it’s value out to the agent Log.
Sub Cumulative (dept1 As String)
departmentList(Cstr(deptListIndex))= deptDoc.Department(0)
If Iselement(departmentList(dept1)) = True Then
Do While JobDoc is Nothing
' some code
Do while Not doc Is Nothing
' some more code relevant to first loop
Loop
Loop
Else
Print “Should not be here, since value does exist in list!”
End If
End Sub
Any help appreciated… thanks in advance.