controlsource

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    controlsource

    hey all, i have a question i have a field on a form called (matlogo) ok and i have added another field that is unbound (textbox control) and i tried to input in the controlsource a iif code something like this:

    Code:
    =iif([matlogo]=[somename],"thursday")
    but when i execute this code it just says name# weird huh? because when i change the code to another field in the form like this:

    Code:
    =iif([routenumber]=32,"steve")
    then it displays "steve"

    why does it do this for the second code and not the first one.

    lee123
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Hi Lee

    Is [somename] also a bound textbox on the form? If it is check the Name property of the textbox. It may not actually be [somename]

    Mary

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      well actually the form it self has a search on it and when i search for a name of a mat it displays in the textbox (matlogo) so the textbox (matlogo) is bounded:

      Code:
      =iif([matlogo]=[texas roadhouse],"thursday")
      to answer your question [somename] is a name of a mat
      i think i answered your question.

      lee123

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Try this ...

        Code:
        =iif([matlogo]="texas roadhouse","thursday")

        Comment

        • lee123
          Contributor
          • Feb 2007
          • 556

          #5
          thanks mmccarthy, that worked you know it's funny you have to put quotes around it when all of the others you don't. why is that?

          lee123

          good to hear from you i haven't seen you lately thanks.

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Originally posted by lee123
            thanks mmccarthy, that worked you know it's funny you have to put quotes around it when all of the others you don't. why is that?

            lee123

            good to hear from you i haven't seen you lately thanks.
            Number values don't need quotes but string or text values do.

            Comment

            Working...