Create a collection from another database using a search formula.

The code below will return all the docs in the specified database whose EmployeeUniqueID field matches the value specified. You can nest this code in a For Next loop and replace the EmployeeUniqueID with an array. You will need to populate Server and Path in the example below.
LotusScript


Dim session as New NotesSession
Dim sdb as NotesDatabase
Set sdb = session.GetDatabase( Server, Path )

Dim EmployeeUniqueIDFormula$	
EmployeeUniqueIDFormula = "EmployeeUniqueID = " & Chr(34) & "899-123456" & Chr(34)
		
Dim cutoffdate As New NotesDateTime( "01/01/0001" )

Dim collect As NotesDocumentCollection
Set collect = sdb.Search( EmployeeUniqueIDFormula , cutoffdate , 0 )

Posted by fbrefere001 on Thursday March 21, 2002