Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim view As NotesView
Set view = db.GetView("AssignmentStubs")
Dim doc1 As NotesDocument
Set doc1 = view.GetFirstDocument
Dim doc2 As NotesDocument
Set doc2 = view.GetNextDocument(doc1)
Dim DocCounter As Long
DocCounter = 1
Dim ErrorCounter As Long
Do
If doc1.EmployeeUniqueID(0) = doc2.EmployeeUniqueID(0) Then
If doc1.HostAssignmentID(0) = doc2.HostAssignmentID(0) Then
Msgbox "The is a duplicate assignment stubs for " & doc1.EmployeeUniqueID(0) , 0 + 64 , "Duplicate Found"
ErrorCounter = ErrorCounter + 1
End If
End If
Set doc1 = doc2
Set doc2 = view.GetNextDocument(doc1)
DocCounter = DocCounter + 1
Print DocCounter & " assignment stubs compared ~ " & ErrorCounter & " errors found"
Loop Until doc2 Is Nothing
Print "Done"
End Sub