Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parameter Query (Access 2003)

    I have a field in my query [EndDate]. I would like it to prompt the user for dates between eg. March 4 and March 10. How do I set this up in the query - and resulting report.
    Thank you for any suggestions or help.

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

    Re: Parameter Query (Access 2003)

    You could put the following in the Criteria line:

    Between [Enter First Date] And [Enter Last Date]

    Select Query | Parameters.
    Enter [Enter First Date] in the Parameter column, and select Date/Time as data type.
    Enter [Enter Last Date] in the next row in the Parameter column, and select Date/Time as data type.
    Click OK.

    You can refer to [Enter First Date] and [Enter Last Date] in the control source of a text box on the report, for example

    =[Enter First Date]

    or

    ="Report for the period from " & [Enter First Date] & " to " & [Enter Last Date]

    Alternatively, set up a form with two text boxes txtFirstDate and txtLastDate, format them as dates, and use [Forms]![NameOfTheForm]![txtFirstDate] and [Forms]![NameOfTheForm]![txtLastDate] as parameters instead of [Enter First Date] and [Enter Last Date].

Posting Permissions

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