Query Criteria [Forms]![Collections_MASTER]![Combo118] OR show All

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartcarfun
    New Member
    • Feb 2012
    • 6

    #1

    Query Criteria [Forms]![Collections_MASTER]![Combo118] OR show All

    In MS Access 2010 I am trying to use the
    Code:
    =[Forms]![Collections_MASTER]![Combo118]
    in the criteria for field [Teams] and it works fine.

    But if the combo is blank it shows nothing, can I make it so the blank combo shows everything, ie no criteria is applied...

    Thanks in advance
  • smartcarfun
    New Member
    • Feb 2012
    • 6

    #2
    I tried the code below but no luck;
    Code:
    IIf([Forms]![Collections_MASTER]![Combo118] Is Not Null,[Forms]![Collections_MASTER]![Combo118])

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Is it blank or is it null? They are different and you need to use the right one. Also, your IIf syntax is missing the return value for the false parameter.

      Comment

      • smartcarfun
        New Member
        • Feb 2012
        • 6

        #4
        I found that this works;

        Code:
        [Forms]![Collections_MASTER]![Combo118] Or [Forms]![Collections_MASTER]![Combo118] Is Null
        However when I try to use on more than one field it doesn't like it.
        Im also using After Update - requery on unbound combo boxes (not sure about this bit???)

        Thanks

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          Originally posted by SmartCarFun
          SmartCarFun:
          However when I try to use on more than one field it doesn't like it.
          You'll need to explain yourself better than that if we're to understand what you mean.
          Originally posted by SmartCarFun
          SmartCarFun:
          Im also using After Update - requery on unbound combo boxes (not sure about this bit???)
          Again, what is this even about?

          NB. The solution you came up with shows you're thinking well and on the right lines. I have no idea what problems you're having with it due to how it was expressed.

          Comment

          • smartcarfun
            New Member
            • Feb 2012
            • 6

            #6
            Thanks for your reply, I appreciate it's difficult to understand...

            Not to waste your time, ive moved on to VBA code so I have opened a new thread you might be able to look at, its the same problem (a little further along) but a different approach.

            Thanks a mill


            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32669

              #7
              Running late so rushing away.

              I'll look at the linked thread when I can. I notice you say it has two questions in it though. It may be wise in the mean time to reorganise it so that each question is in its own thread. We only allow one question per thread (Everybody benefits from this approach). Nice idea to split to a new thread though ;-)

              Comment

              Working...