Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Re: Easy Date Range for Report

Discussion in 'Information Technology' started by Adnan, Jul 28, 2006.

  1. Adnan

    Expand Collapse

    Thnak you Fred, your posted option 2) has helped me, too. I love it - Ones
    Please post all your inquiries on this community so we can all benefit -
    Thank you!

    "fredg" wrote:

    > On Tue, 9 Aug 2005 08:45:13 -0700, DianaS wrote:
    > > Hi,
    > >
    > > I would like to make it very easy for users to control the date range of a
    > > report. Is there a way I can create a simple form or text boxes in my report
    > > for entry of the date range by the user? For example "StartDate" and
    > > "EndDate" textboxes in my report. I want to avoid having users enter date
    > > ranges in the actual query.
    > >
    > > Alternate solutions also appreciated.
    > >
    > > Thanks,
    > > Diana

    > 1) If you are using a query as record source for the report, an easy
    > method is to have the query prompt for the date range.
    > On the Criteria line of the date field in the query, write:
    > Between [Start Date] and [End Date]
    > If you also wish to show the entered date range in the report, add an
    > unbound control to the report header.
    > Set it's Control Source to something like:
    > ="For sales between " & [Start Date] & " and " [End Date]
    > Note... the text inside the brackets must be identical to the
    > bracketed text in the query.
    > 2) A better method would be to use a form to enter the date range in.
    > Create an unbound form. Add 2 Text Controls.
    > Name one StartDate and the 2nd EndDate.
    > Add a command button.
    > Code the button's click event:
    > Me.Visible = False
    > Name this form 'ParamForm'.
    > In the query that is the record source for the report, in it's Date
    > field's criteria line, write:
    > Between forms!ParamForm!StartDate AND forms!ParamForm!EndDate
    > Next, code the main report's Open event:
    > DoCmd.OpenForm "ParamForm", , , , , acDialog
    > Code the main report's Close event:
    > DoCmd.Close acForm, "ParamForm"
    > When ready to run the report, open the report. The form will display
    > and wait for the entry of the dates. Click the command button and the
    > report will run without need for any further parameter entries. When
    > the report closes, it will close the form.
    > If you wish to display the parameters in the report, set the control
    > source of the unbound control to:
    > = For sales between " & forms!ParamForm!StartDate & " and " &
    > forms!ParamForm!EndDate
    > --
    > Fred
    > Please only reply to this newsgroup.
    > I do not reply to personal email.
  2. Loading...

    Similar Threads Forum Date
    Why its easy to be a Sikh and the Master of Puppets Blogs Oct 17, 2015
    easy, develop another addiction! Blogs Oct 16, 2015
    How To Conquer the World: Easy (by the Poet Warrior) Sikh Youth Feb 23, 2013
    USA Not easy to divide Wisconsin Sikh Gurdwara Shooting Donations... Breaking News Sep 6, 2012
    Opinion Human Evolution: No Easy Fix Breaking News Oct 5, 2011

Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     

Share This Page