Urgent - getting first docuemnt and update the parent

I have two forms say form1 and form2(form1 belong 1.nsf database and form2 belongs to 2.nsf).In form1 we have 100 employees. suppose i am accessing employee number 10 and going to form2 with the same employee where we will more than one record for employee number 10. In this case i must select only first record of the form2 for employee number 10 and update the form1 fields. if i edit other records it should not update anything. I hope u understood what i am asking…pls help me.

Following is my code. but its not working

Sub Queryopendocument(Source As Notesuiview, Continue As Variant)

Dim ws As New NotesUIWorkspace

Dim uidoc As notesuidocument

Dim docs As NotesDocumentCollection

Dim doc As NotesDocument

Dim flag As Boolean

Dim session As New NotesSession

Dim db As NotesDatabase

Set db = session.CurrentDatabase

Set docs = Source.Documents

Set doc = docs.GetFirstDocument

If Not (doc Is Nothing) Then

flag = ws.DialogBox ( “Renewal”, True,True,False, True, False, False, “Edit Entry”,doc,False,False,True)

uidoc.FieldSetText(“dxStart”,Cstr(Format(doc.dxstart(0),“mm/dd/yy”)))

Call uidoc.FieldSetText(“dxExpiry”,Cstr(Format(doc.dxExpiry(0),“mm/dd/yy”)))

Call doc.save(True,False)

Call uidoc.Save

Call ws.ViewRefresh

continue=False

Else

flag = ws.DialogBox ( “Renewal”, True,True,False, True, False, False, “Edit Entry”,doc,False,False,True)

End If

End Sub

Subject: urgent - getting first docuemnt and update the parent

you need to do two things

  1. at the time of creating new document i the form2 create 1 field with name of parent, so when you create a document in form 1 take this docuemnt uni id and save in that document and in second form make one more field for numbering based on this uni id you increment the number so that basd on key and paent id you can update the inormation in the documents of form 2

for queries contact reddylotus@gmail.com or 09176219252