Thanks for your response. I did mistake here as
two documents are not required. Please look at this below code. Still problem exists.
Sub Entering(Source As Field)
Dim s As New notessession
Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As notesdatabase
Dim doc As notesdocument
Dim Code,UserName, UserName1 As Variant
Set uidoc = ws.CurrentDocument
Code = uidoc.FieldGetText( "EmpCode" )
Set db = s.Getdatabase("Hub/Wipro", "names.nsf")
Set view = db.getview ("(ShortName)")
Set doc = view.GetDocumentByKey( Code )
On Error Goto Skip
UserName = doc.GetItemValue ("DisplayName")
UserName1 = UserName(0)
Call uidoc.FieldSetText ("EmpName", UserName)
Exit Sub
Skip: Msgbox "User does not exist in domino directory"
End Sub
Feedback response number WEBB8W4JUP created by Meena Ramesh on 07/11/2012