responses documents at all levels from the parent document.
This code getting the value of NPR_number in the parent or current document and
update all responses and responses to responses of parent and all response
documents with this value.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim nprnumber As String
Set uidoc = workspace.CurrentDocument
nprnumber = uidoc.fieldgettext("NPR_Number")
Set doc = uidoc.Document
Call updateresponses(doc, nprnumber)
End Sub
Sub updateresponses(doc As NotesDocument, number As String)
Dim collection As NotesDocumentCollection
Dim currentResponse As NotesDocument
Set collection = doc.Responses
Set currentResponse = collection.GetFirstDocument
While Not ( currentResponse Is Nothing )
Call currentResponse.ReplaceItemValue("NPR_Number",number)
Call currentResponse.Save(True,False)
Call updateresponses(currentResponse, number)
Set currentResponse = collection.GetNextDocument(currentResponse)
Wend
End Sub
Surendra Talluri
This was first published in November 2000