Function LSDbCol(s As NotesSession, servernm As String, dbname As String, vname As String, colno As Integer) As Variant ' this function retrieves a view's column values from the database (db) in a specified view ' this function returns the resulting values of the lookup as an array. Dim lupDb As NotesDatabase ' lookup database Dim lupV As NotesView ' lookup view Dim eCol As NotesViewEntryCollection ' all entries in view Dim e As NotesViewEntry ' entry of eCol Dim tmpcount As Long ' counting variable for tmpArray Dim tmpArray() As Variant ' values of lupItem in lupdoc(s) On Error Goto LUpErrorHandler ' get database Set lupDb=s.GetDatabase(servernm, dbname, False) If (lupDb Is Nothing) Then ' return nothing LSDbCol="" Exit Function End If Set lupV=lupDb.GetView(vname) If (lupV Is Nothing) Then ' return nothing LSDbCol="" Exit Function End If Set eCol=lupV.AllEntries Set e = eCol.GetFirstEntry() If (e Is Nothing) Then ' no entries in view, return nothing LSDbCol="" Exit Function End If ' have entries, loop and add to new list tmpcount=0 While Not (e Is Nothing) ' redim array Redim Preserve tmpArray(tmpcount) ' get column value tmpArray(tmpcount) = Cstr(e.ColumnValues(colno)) tmpcount=tmpcount + 1 Set e = eCol.GetNextEntry(e) Wend ' return result LSDbCol=tmpArray Exit Function LUpErrorHandler: ' print error to console Print "(LSDbCol) Unexpected error: " & Error$ & " (" & Cstr(Err) & "), on line: " & Cstr(Erl) ' return nothing LSDbCol="" Exit Function End Function