User input into an Access Report

Posted on 2006-05-01
Last Modified: 2013-11-28

Not sure if this is possible:  Access 2003:

I have a Report that derives its info from a Query that asks the user to specify records with the DATE field between 2 dates.  That works fine when I run the Report and I get the correct records in the resulting Report.

Is there a way that the two dates that the user specifies when running the Report can be entered into the Report itself (e.g. like in Word when you have Fillin fields that prompt for user info that is then put into the document at the specified location).

I think I may be asking too much??!!

Thanks, Gail
Question by:GAILBAKER
    LVL 77

    Accepted Solution


    In the query that contains the parameter field just add two more columns which are the parameter fields themselves.

    Mystart:[Enter start date]

    myfinish: [Enter end date]

    The bits in [] must be exactly the same as the criteria entries.

    These will now be fields in your reports recordsource and you can use them in the report like any other field.

    LVL 3

    Expert Comment

    Just a tip -- if you have, say, monthly dates, you may want to use a form with a dropdown to select the dates instead of forcing the user to type in the to/from dates every time.  If your dates are actually any day to any day, then the only advantage a form would give is persistence (of the entered dates) from one run to the next.

    LVL 11

    Expert Comment

    You can pass the date values to your query with a form. Then, on the report, create a text box and in the control source:

    "Period - "&Forms!FormName!StartDate&" to "&Forms!FormName!EndDate
    LVL 2

    Expert Comment

    As mentioned above, having a form is the best way of doing this. I use this method on all my databases and use this calendar to let users choose the dates (also as mentioned above):

    This ensures the date formatting is always correct and means you can easily output the inputted dates in your reports.

    Author Comment

    Thanks Pete, this worked really well.  The other solutions were beyond my amateur capabilities!


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now