Notes error: Invalid or nonexistent document ; when unlocking a document

This question is related to this question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_26551298.html

1. It was working last week and today it is giving me the error message
2. The form was created from a button that contains these code:
     @Command([FileSave]);
     @Command([Compose];"";"FlexRepairProcess");
3. The FlexRepairProcess form created and saved just fine but when I close the form, the code stops at the Queryclose event when it tries to unlock the document
     Sub Queryclose(Source As Notesuidocument, Continue As Variant)
       Dim doc As NotesDocument
       Set doc = source.Document
       Call doc.UnLock
     End Sub

Again this has been working for almost 2 weeks and suddenly it stopped working. I googled this problem and most people have problem with their mail files and that's not the case with me.
LVL 2
coronoahcoroAsked:
Who is Participating?
 
coronoahcoroConnect With a Mentor Author Commented:
I just changed the Queryclose event to
	Dim doc As NotesDocument
	Set doc = source.Document
	If doc.LockHolders(0) <> "" Then
		Call doc.UnLock
	End If

Open in new window


It looks like it is working just fine now...I'm going to run some tests on it.
0
 
Sjef BosmanGroupware ConsultantCommented:
Do you have to unlock it explicitly, isn't the document automatically unlocked? Furthermore, why lock a new document?

If there is indeed a disk-based document (which I doubt), the error could be related to some sort of bug in Notes where it gets confused between two on-screen documents. Sometimes it's worth to grab NotesUIWorkspace.CurrentDocument instead of the Source parameter...
0
 
coronoahcoroAuthor Commented:
This happens only the very first time after the document is created, saved, and closed. The error doesn't show up anymore afterward. I can open and close document (+ unlocking it) just fine.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
coronoahcoroAuthor Commented:
I had to do it explicitly because in the past when I tested this, there were times when a document is in locked status even though that doc was saved and close.
0
 
Sjef BosmanGroupware ConsultantCommented:
I suppose it won't work on a new (or newly saved) document. Can you just leave the lock in that case? Or, dirty: add a line with
      On Error Resume Next
right before the line with Unlock...
0
 
Sjef BosmanGroupware ConsultantCommented:
Don't delete the question, for it might help someone else with a similar problem. Just accept your own answer.
0
 
coronoahcoroAuthor Commented:
ok will do. thanks
0
 
coronoahcoroAuthor Commented:
This is what works in this case
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.