Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    98

    Unanswered: Parameter trouble

    Hi,

    I want to create a selection on the data in the database, based on the input of the user. THe input is done via a report using parameter thingies ([ ])in the query. My problem is that I don't know what to do when I want to select everything. So say I wanted all names (parameter value) between 12-12-01 and 12-12-05 (also parameter values)

    How can I do this? PLEASE HELP!

  2. #2
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244
    The query criteria would be :

    BETWEEN [Enter First Date] AND [Enter Last Date]

    I hope this helps
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

  3. #3
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Question

    Originally posted by andybriggs
    The query criteria would be :

    BETWEEN [Enter First Date] AND [Enter Last Date]

    I hope this helps
    Just curious:
    In such parametre queries, is there a way to suggest two standard values for the user, still leaving him/her with a choice to change them before the query is run?

  4. #4
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244
    You could, of course, build a form for the user to input their values. You could set defaults in this form easily enough. Then, in your query, the criteria would become :

    BETWEEN Forms!NameOfForm!NameOfControl AND Forms!NameOfForm!NameOfControl

    For example, let us suppose that you create a form called FrmParameterInput. On this you have two text boxes for the user to input a date range. Let us call those TxtFrom and TxtTo.

    Then, in your query :

    BETWEEN Forms!FrmParameterInput!TxtFrom AND Forms!FrmParameterInput!TxtTo


    It is generally better to build your own interface for entering query criteria as you have control over what the user is allowed to type (for example by using Input Masks). The standard "Enter Parameter" dialog in Access allows no error control at all. Also, if you are inputting parameters across multiple fields, the user quickly gets fed up with entering criteria in lots of dialog boxes. Worse, they can't see the complete criteria before they run the query. And, of course, you can build your form to allow ANDs and ORs too, which you can't do otherwise.

    But this is a big subject and we could be here for hours, so I hope at least I've given you a few ideas.

    Good luck!!
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

  5. #5
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369
    Originally posted by andybriggs
    But this is a big subject and we could be here for hours, so I hope at least I've given you a few ideas.
    Yep, thanks.

Posting Permissions

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