Sub Queryrecalc(Source As Notesuidocument, Continue As Variant)
On Error Goto Errh
Dim Doc as NotesDocument
Set Doc = Source.Document
if Doc is Nothing then Exit Sub
Dim session As new NotesSession
Static db As NotesDatabase
Static view As NotesView
if db is Nothing then Set db = session.GetDatabase("Elephant/ICTP","Work/Docs/performing.nsf")
if view is Nothing then Set view = db.GetView ("ContragentsForContracts" )
Dim OtherDoc as NotesDocument
Set OtherDoc = view.GetDocumentByKey(Doc.GetItemValue("ContractParties")(0), True)
if Not OtherDoc is Nothing then
Call Doc.ReplaceItemValue("TaxPay", OtherDoc.GetItemValue("ContractPartyActive")(0))
end if
Exit Sub
errh:
Msgbox Error & | in line | & Erl(), 64, |Lotus Notes (| & Lsi_info(2) & |)|
Exit Sub
End Sub