Update form changes lotusscript

I have a form1, on this form is a button that opens a new form2 where you can enter some numbers.When you close this form2 there is lotusscript that counts all the form2 that it finds and then counts the numbers and put that in form1.

But the problem is, form1 is not in edit mode en the changes made with the lotusscript aren’t updatet until you close the form en reopen it.

Can somebody help me?

Sub Queryclose(Source As Notesuidocument, Continue As Variant)

Dim formula As String

Dim doc As NotesDocument

Set doc = Source.Document

Dim s As New notessession

Dim Db As notesdatabase

Set Db=S.CurrentDatabase

Dim doc1 As notesdocument	



Set documenten1 = Db.getview(".LookupVerlofAanvraag")

Set doc1=documenten1.getfirstdocument

Do While Not (doc1 Is Nothing)

	If doc1.EMPLNUMB(0) = doc.EMPLNUMB(0) Then

		verlof = doc1.VerlofOpnemen(0) + verlof

		compensatie = doc1.CompensatieOpnemen(0) + compensatie

	End If

	Set doc1=documenten1.getnextdocument(doc1)

Loop 



Set documenten = Db.getview(".LookupVerlofKaart")	

Set doc1=documenten.GetDocumentByKey(doc.EMPLNUMB(0))

Do While Not (doc1 Is Nothing)

	If doc1.EMPLNUMB(0) = doc.EMPLNUMB(0) Then

		doc1.VerlofOpgenomen = verlof

		doc1.VerlofRest = (doc1.RestVerlof(0) + doc1.Verlof(0)) - verlof

		doc1.CompensatieOpgenomen = compensatie

		doc1.CompensatieRest = doc1.Compensatie(0)  - compensatie	

		Call doc1.Save(True,False)

		Set doc1=documenten.getLastDocument

	End If

	Set doc1=documenten.getnextdocument(doc1)

Loop 

End Sub

Subject: Control the UI

It seems like you’re just not reloading the back-end doc.

I would probably do something similar to your setup:

  1. Never let form1 be in edit mode when invoking form2; 2) on save (not close) of form2, do your summing and update the back-end form1 doc; 3) reopen form1 doc

You would want a nice clean function to do step 2.

I would probably only keep one doc open in the UI, too, to prohibit the user switching around (or use dialogbox). You could have the QueryClose of doc2 be smart and reopen doc1.

Hope that points you in the right direction.