Lotus Part of the code no longer executed

Posted on 2007-10-08
Last Modified: 2013-12-18
Hi All,

Here's my problem: I'm developping a lotus notes database for creation of request, where users just have to fill a form and the request is automatically processed. Part of my code is used for checking whether or not a field has a value, and, if not, prompt the user with an error message.
Until this morning, it worked perfectly. even though, I tried to add a "Save as draft" button, add a if statement at the beginning of my code, it seemed to work fine, when I realized the control field wasn't working anymore. I simply removed my If statement to have the original code, but it doesn't work as before....
Here's an example of my code (it's located in QuerySave of the form, and it's not in an IF statement or a sub, or a loop....) :

      Msgbox("Draft!!!! 2")
      If doc.Type1_1(0) = "" Then
            MsgText= MsgText + "Specify a value for Type/Media." + Chr$(13)
      End If
      Msgbox("Draft!!!! 3")

The If statement worked perfectly as of this morning. Now, when I process the request, before closing, I can see two popup: "Draft!!! 2", then "Draft!!! 3", but the code beetween isn't working! My field Type1_1 has no value, so it should work and display an error message( it was before this morning!!)!!!!!!!!
I'm getting crazy on this thing. Is it possible I disabled something? I put a lot of Msgbow all along my code, it's properly displayed but part of the code beetween never work, where some other part work fine!
Great thanks by advance for all those motivated to check this problem!
Question by:abissa
    LVL 2

    Author Comment

    More inof (it it can help):

    I added in my code the following:

          Msgbox("Draft!!!! 2 The RqTitle field value is:" + doc.RqTitle(0))
          If doc.RqTitle(0) = "" Then
                MsgText= MsgText + "Specify a value for Request Title." + Chr$(13)
          End If
          Msgbox("Draft!!!! 2")

    This way, I check the value of the field before testing it. If, while creating the request, I enter "somthing" in the field, when I save the request I have two pop up:
    "Draft!!! 2 The RqTitle field value is: somthing"
    "Draft!!! 2"
    So definitly, it's reading my code. So why, when the value is NULL, it doesn't display the stupid pop up " Specify a value for Request Title"????????
    LVL 22

    Accepted Solution

    This might be a stupid question, but are you checking MsgText at the end of your code and displaying it when it is not a NULL string?  I don't see any mention of a message box that displays the MsgText string in your posts.
    LVL 63

    Assisted Solution

    I think that it may not be an actual null.

    1) I always use trim before checking fields, since there may be default blanks.
    2) Check the default field value again., and also print out the Length of the data.

    I hope this helps !
    LVL 2

    Author Comment

    First, thanks to both of you for the answer.
    Then, I gave 500 points to the question as it was quite urgent, but without any answer two hours later, I just used an old backup and spent a lot time updating the old form.
    But I'm still curious about what went wrong.
    Anyway, I'm closing this post without giving any points, but thanks for the idea thought.
    LVL 31

    Assisted Solution

    Ha! 2 hours and no answer, I guess this iste is falling apart.  Ask for a refund for your Premium Membership. LOL

    Seriously, though, Bill is right.  You used to have code at th ebottom that looked something like:

    If MsgTxt <> "" Then
      Msgbox MsgTxt
      Cancel = True
    End If
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    This is an old article, please see an updated version of this article, located here:
    Article by: Rob
    Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now