Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009
    Posts
    2

    Unanswered: Using UDF in Query Criteria - problem

    Afternoon all,

    Long time reader, first time poster. Having some problem with using a UDF as criteria for a query, I can make the UDF spit out a simple string and then use this and works fine, however I need it to create multiple OR criterion and hitting a brick wall, no matter what combination of quotes, double quotes, CHR codes etc I wrap the strings in it's not playing ball. Anyone any ideas?

    (I cant put the criteria on multiple rows which would be simple for a long boring reason I wont go into)

    This is working......
    Code:
    Public Function BuildCriteria() As String
    BuildCriteria = "Example"
    End Function
    ...putting an OR statement in there throws an error though

  2. #2
    Join Date
    Dec 2009
    Posts
    2
    I have scoured every nook and cranny of the interweb now and come to the conclusion now that this isnt possible.

    Having to resort to a convoluted and lengthy CASE SELECT routine, such is life.

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    go the other direction.

    Pass your field value in to the function and let the function do the "or"ing for you.

    Then return true or false.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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