getAllDocumentsbykey

Hi folks,I want to get all the documents in a view by an ID which I am using as a key. This ID is in the current document. Basically then when I loop through the views I want a certain columns values and add them all together and then populate the field with the result. The problem is that “dc” in the following code is not getting populated with anything. Is my key right??? What is the problem??? Any help is appreciated, thanks…

    Dim dcDoc As NotesDocument

Dim v As NotesView

Dim dc As NotesDocumentCollection

Set v = db.getview("Approved")	



Set dc = v.GetallDocumentsByKey(doc.ID(0), True)



    Set dcDoc = dc.GetFirstDocument 

nleave = 0

For x = 1 To dc.count

	nleave = nleave + dcDoc.ReqWDays_N

	Set doc = dc.GetNextDocument (doc)

Next x

Subject: getAllDocumentsbykey

Assuming you already have a handle on your doc object (not evident from the posted code) and that the ID field exists and contains the correct value (I assume you have checked using the debugger)then your code looks ok.

It could be your view - if the column your are searching is not sorted it will not find anything.

Subject: Thanks justin, thats what the prob was!!