I've created a database to track the projects in my workplace, but from time to time different users got 'Object Variable Not Set' error. The problem is it doesn't always happen. For example one user opened a project in process and got the error, when I debugged it, I see that one field somehow did not show up on the document hence causing the error when the code tried to get the value of the field. BUT when I tried to open the same project, it opened just fine.
Again, this doesn't happen everytime and the same user that got an error opening one project can open other projects just fine. But I know when the error message show up it's always caused by one field 'Status Comment'. What I don't understand is why it works sometimes and not the other times.
Attached is the snippet of the code
Set workspace = New NotesUIWorkspace
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set item = doc.GetFirstItem("StatusComments")
' This is the point where the program stops. For some reason 'StatusComments field does not show up on the Item list in the doc
statuscomments1 = item.Text