Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    1

    Exclamation Unanswered: multiple parameter criteria in queries

    i have a query (in my database) and it has multiple parameter criteria in it, there are 7 in total. WHat i would like to do is create a form that will allow the user to input all the criteria at once in the form, hit the ok button and send all the inputs to the query and then open up a report based on the entered values.

    I have done this before, but the problem was you had to enter a value into each parameter, you couldnt miss 1 or 2 out. This is a slight problem, because i do not want to always enter values in all of the parameter criteria's. Is there anyway to get around this or solve my problem. An online tutorial or step by step guide would be very very good, or just point me in the right direction.

    Cheers guys

    ps. im not a database genious, so go easy on the technical wording lol.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    set up your criteriaBoxes on a form and visible = false them

    set up a secondSetOfBoxes for the user to play with.

    on goFind_click visit each of your secondSetOfBoxes and set the value of the corresponding criteriaBoxes to:
    iif(isnull(thisbox.value), "*", "*" & thisBox.value & "*")

    tie your query criteria to:
    like criteriaBoxes

    ...and you gain sub-string search for each of your criteria.
    ...and you lose a lot of time in a humungous database.

    it works fine for me in my typical 50k-record db without too much time penalty(milliseconds on a PIII-333), but on a mega-record db the like will slow you down too much so use iif(isnull(thisbox.value), "*", thisBox.value) and drop the LIKE
    Last edited by izyrider; 01-06-03 at 17:58.

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ooops!

    and add a second button clearCriteria that NULLs all the secondSetOfBoxes

    izy

Posting Permissions

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