Sub Click(Source As Button)
Dim curdb As NotesDatabase <br/>
Dim session As New NotesSession <br/>
Dim firstview As NotesView <br/>
Dim viewdoc As NotesDocument<br/>
Dim firstviewcollection As NotesViewEntryCollection<br/>
<br/>
<br/>
Set curdb =session.Currentdatabase<br/>
Set firstview =curdb.GetView("AddForm")<br/>
Set firstviewcollection=firstview.AllEntries<br/>
Dim Fentry As NotesViewEntry<br/>
Set Fentry=firstviewcollection.GetFirstEntry<br/>
<br/>
While Not Fentry Is Nothing<br/>
Set viewdoc=Fentry.Document<br/>
Msgbox viewdoc.uname(0)<br/>
<br/>
Dim nextdb As NotesDatabase <br/>
Dim nextsession As New NotesSession <br/>
Dim secondview As NotesView <br/>
<br/>
<br/>
Set nextdb=nextsession.GetDatabase("","names.nsf")<br/>
If Not nextdb Is Nothing Then<br/>
Msgbox "A"<br/>
End If<br/>
Set secondview =nextdb.GetView("($Users)")<br/>
If Not secondview Is Nothing Then<br/>
Msgbox "B"<br/>
End If<br/>
Dim secondoc As NotesDocument<br/>
Msgbox "Secondloop"<br/>
'Set notesDocument = notesView.GetDocumentByKey( keyArray [, exactMatch% ] )<br/>
Set secondoc=seconddoc.GetDocumentByKey(viewdoc.uname(0),True)<br/>
Msgbox secondoc.shortname(0)<br/>
Set Fentry=firstviewcollection.GetNextEntry(Fentry)<br/>
<br/>
Wend<br/>
<br/>
End Sub
The Loop Iterates for the first time and next time it tries to fetch the short name from names.nsf database it does not .. the code is not working from this part
Set secondoc=seconddoc.GetDocumentByKey(viewdoc.uname(0),True)
Msgbox secondoc.shortname(0)<br/>
Set Fentry=firstviewcollection.GetNextEntry(Fentry)<br/>
Thanks for help
Roopa