Store Value of Input For a Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Proaccesspro
    New Member
    • Apr 2007
    • 132

    Store Value of Input For a Report

    Hello All,

    I have a report that allows the user the ability to find all orders that are over a certain days old. It is up to the user to determine how many days back they want to go. (It is a input parameter to the query). How can I capture their input and then use that value in the HEADER of a report....SO, if they were to input 45, the report header would read "Orders 45 Days Old"
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by Proaccesspro
    Hello All,

    I have a report that allows the user the ability to find all orders that are over a certain days old. It is up to the user to determine how many days back they want to go. (It is a input parameter to the query). How can I capture their input and then use that value in the HEADER of a report....SO, if they were to input 45, the report header would read "Orders 45 Days Old"
    You need to make a parameter declaration at the beginning of the query. For example ...

    PARAMETERS [NumDays] Long;
    SELECT DateField, OtherField
    FROM TableName
    WHERE (((DateField)<= Now()-[NumDays]));

    Now to refer to it on the form just use an unbound textbox and set control source to ...

    =[NumDays]

    Comment

    Working...