Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Build Criteria Code (2003)

    Was wondering if someone could look at this code and see why when I have all the check boxes checked on my form that it won't show each field criteria as true. Some combinations allow me to have 6 fields showing as true and some will only allow up to two. I tried manually entering the string with the info the function is suppose to provide and all fields showed with criteria as true so there is something wrong with the buildcriteria function. I'm not very good at VBA so I don't even know how to see what my function is producing in the string. Any help would be appreciated.

    Thanks,
    Kent

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Build Criteria Code (2003)

    Some of the lines building strCriteria are of the form

    strCriteria = strCriteria & <condition> & strLogic

    but others are of the form

    strCriteria = <condition> & strLogic

    The latter starts the strCriteria from scratch, discarding everything that has been assembled before it. All those lines should follow the pattern of the first.

  3. #3
    Star Lounger
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Build Criteria Code (2003)

    Thanks Hans. Guess I was staring at the code too long. Can't believe I missed that. That does make a difference.

    Thanks again!

    Kent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •