There is an application on Lotus notes 5. The getdocumentbykey function is not working if the view is open. If some other view is open or if the Database is closed then the function is working correctly and finding the document. How can we make it work even if the view is open? I have given the part of the code below. Thank you.

```
    BillNo2 = cdoc.fieldgettext("Bill_No2")
    Set view = db2.GetView("Bill No.")
    Set doc = view.getdocumentbykey(BillNo2)
    If Not doc Is Nothing Then
        doc.DOdone = "Done"
        doc.LorryNo = cdoc.fieldgettext("Lorry_No")
        doc.TripNo = cdoc.fieldgettext("Trip_No")
        Call doc.save(True, True)
    End If

```

While debugging, its skipping the line "If Not doc is Nothing" and ends the loop even there is document. The same code works fine if the view is not open. Kindly help me. Thanks.