Function GetParentDocument( doc As NotesDocument )
Dim db As NotesDatabase
Dim parentDoc As NotesDocument
Set db = doc.ParentDatabase
If doc.IsResponse Then
Set parentDoc = db.GetDocumentByUNID _
( doc.ParentDocumentUNID )
End If
Set GetParentDocument = parentDoc
End Function
This function can be called from any script. For example:
dim myQuestion as NotesDocument
dim yourAnswer as NotesDocument
'...set value of yourAnswer...
set myQuestion = GetParentDocument( yourAnswer )