Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Help with finding a Object Not Set

Posted on 2004-09-20
11
239 Views
Last Modified: 2013-12-18
I have a very simple form that I copied from a differnt database.  When I go to save the copied form, I get the prompt box

Object Variable Not Set  - what is the best way to try and find the variable.  This is a exact copy of the form from the other database that works fine.  I am not sure where the variable could be hiding.  Any suggestions would be great.

Jaziar
0
Comment
Question by:Jaziar
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12102742
Use debugger to find out which line is giving this error.. .then you know what variable is not set !

~Hemanth
0
 

Author Comment

by:Jaziar
ID: 12102783
Set backEndDoc = lookupView.GetDocumentByKey(frontEndDoc.UniversalID)

Here is the line - could you explain a little what he is trying to do here.  I will paste all the querysave for reference

Sub Querysave(Source As Notesuidocument, Continue As Variant)
      Dim doc As NotesDocument
      
      Set doc = Source.Document
      frontEndFieldContent = Source.FieldGetText("MachineRemarks")
      
      If Not doc Is Nothing Then
            If Right(frontEndFieldContent, 1) <> ")" And  frontEndFieldContent <> "" Then
                  Call Source.FieldAppendText("MachineRemarks", "   " & getEntryStamp())
            End If
      End If
      
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim ws As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Dim lookupView As NotesView
      
      Set  db = session.CurrentDatabase
      Set uidoc = ws.CurrentDocument
      Set lookupView = db.getView("LookupDocByDocID")
      
      Dim frontEndDoc As NotesDocument
      Dim backEndDoc As NotesDocument
      
      Set frontEndDoc = uidoc.Document
      Set backEndDoc = lookupView.GetDocumentByKey(frontEndDoc.UniversalID)
      
      If Not backEndDoc Is Nothing Then
            Call CompareAndUpdateOwners(frontEndDoc, backEndDoc)
      End If
End Sub
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12102817
Frontenddoc is a uidoc and it's not even saved, how do u expect it's universalid to be in lookupview

Partha
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.

 

Author Comment

by:Jaziar
ID: 12102881
The problemis I did not write, I got assigned to make it work.  The other programmer is no longer with us
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12102911
Jaziar
I am sorry, i didn't see it was in querysave, ANyways things u need to check:

a. check whether lookupview object is set, When you start the debugger  u see a twistie for the lookupview object


He checks whether the document exists, if it doesn't then he calls the compareandupdateowners function

Partha
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12103508
Root of all the problems is this line:

Set frontEndDoc = uidoc.Document

You can't do it.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12103542
When you try accessing the Document property of the uidoc object, it doesn't return a valid NotesDocument object. Hence, your next line fails.

Correct this line >> Set frontEndDoc = uidoc.Document<<

YOu will probably need to use an alternate approach to solve this problem. Anyview that uses UniversalID of a document as a key, will not serve you a purpose in case you try looking up a NEW document that has never been saved. Yes, this code will work just fine on documents that have been saved earlier and are being edited.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12103552
I disagree with ranjeet

Partha
0
 

Author Comment

by:Jaziar
ID: 12103632
P_Partha There is no twistie when the bugger starts on LookupView
0
 
LVL 14

Accepted Solution

by:
p_partha earned 125 total points
ID: 12103653
Set lookupView = db.getView("LookupDocByDocID"), then that means there is no view by that name
Check the spelling


Partha
0
 

Author Comment

by:Jaziar
ID: 12103834
The view spelling was off - Thanks very much and nice job
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question