Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Apr 2003
    Location
    Washington, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Range for multiple reports (XP)

    Good morning to all,
    I created a macro to print preview three reports consecutively but would like to enter the date ranges for each report only once (They would be the same range). Is this possible?
    Any suggestions would be appreciated, Lynne

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

    Re: Date Range for multiple reports (XP)

    The best way to do this is to create a form with two text boxes, one for the start date and one for the end date. You can refer to these in the WhereCondition argument of the OpenReport action. Say that your form is named frmDates and the text boxes are named txtStart and txtEnd. The WhereCondition argument would look like

    Between [Forms]![frmDates]![txtStart] And [Forms]![frmDates]![txtEnd]

  3. #3
    New Lounger
    Join Date
    Apr 2003
    Location
    Washington, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Range for multiple reports (XP)

    I already have a date range form so I used this in the macro in the "where condition" instead of the query but I get an error - can't parse the expression: 'Between Forms![Date Range]![Begin Date] And Forms![Date Range]![End Date]'.

    I don't see any errors and it works in queries.

    Thanks for the assistance, Lynne

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

    Re: Date Range for multiple reports (XP)

    I'm sorry, that's my fault. I forgot the field name in the WhereCondition. It should be

    [DateField] Between Forms![Date Range]![Begin Date] And Forms![Date Range]![End Date]

    where DateField is the name of the field on which you want to filter.

Posting Permissions

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