Problem with CONTROL SOURCE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gilberto
    New Member
    • Aug 2007
    • 135

    Problem with CONTROL SOURCE

    Hello,

    I have a table "LevelTexts " with field "Per1". I need one textbox ("per1txt") in a report to display nothing ("") if the value of "per1"=0, and the value itself ("per1") if its >0.

    Im trying the following in the textbox ("per1txt") control source but i get an #error:

    =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","[leveltexts]",""))

    Any ideas??? Thanks,
    Gilberto
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by Gilberto
    Hello,

    I have a table "LevelTexts " with field "Per1". I need one textbox ("per1txt") in a report to display nothing ("") if the value of "per1"=0, and the value itself ("per1") if its >0.

    Im trying the following in the textbox ("per1txt") control source but i get an #error:

    =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","[leveltexts]",""))

    Any ideas??? Thanks,
    Gilberto
    try:
    =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","leveltexts") ,"")

    Comment

    • Gilberto
      New Member
      • Aug 2007
      • 135

      #3
      Originally posted by puppydogbuddy
      try:
      =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","leveltexts") ,"")
      It doesnt work, it asks me for "leveltexts ".

      Thanks

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        Originally posted by Gilberto
        It doesnt work, it asks me for "leveltexts ".

        Thanks
        Change this:
        =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","leveltexts") ,"")

        To:
        =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","LevelTexts") ,"")

        Comment

        • Gilberto
          New Member
          • Aug 2007
          • 135

          #5
          Originally posted by puppydogbuddy
          Change this:
          =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","leveltexts") ,"")

          To:
          =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","LevelTexts") ,"")
          Thanks but no luck...again it asks for: "LevelTexts ".

          Comment

          • puppydogbuddy
            Recognized Expert Top Contributor
            • May 2007
            • 1923

            #6
            Originally posted by Gilberto
            Thanks but no luck...again it asks for: "LevelTexts ".
            Is LevelTexts the correct name of the table? Double check the spelling and case.

            Comment

            • Gilberto
              New Member
              • Aug 2007
              • 135

              #7
              Originally posted by puppydogbuddy
              Is LevelTexts the correct name of the table? Double check the spelling and case.
              Yes it is. I have other controls using DlookUp to get its value, the problem with THIS specific control is the IIF, which i cant get to work.

              Comment

              • puppydogbuddy
                Recognized Expert Top Contributor
                • May 2007
                • 1923

                #8
                Originally posted by Gilberto
                Yes it is. I have other controls using DlookUp to get its value, the problem with THIS specific control is the IIF, which i cant get to work.
                =IIf(LevelTexts !Per1>0,DLookUp ("[per1]","LevelTexts", "[per1]> 0"),"")

                Comment

                Working...