Hello,

I first want to say, "Thank you so much for replying."  

I'd like to use your first suggestion with the query.  Are you suggesting that 
I first create a button using the button wizard to pull up the results by 
quarter and year?  If so, I've done this, but I'm not sure how or where to put 
in the click event [VBA code] that says:

        DoCmd.OpenREport "MyReportName", AcPreview

I've added my database to the site if you would like to take a look.

Thank you for any help you may have to offer.

Dawn

--- In [email protected], "Peter Groman (peter.groman)" 
<peter.gro...@...> wrote:
>
> 
> (1) A quick and dirty way to do it would be to edit the source query of
> the report and put in criteria for the Quarter & Year like [Enter
> Quarter] and [Enter Year].  Then just create a button that has an on
> click event [VBA code] that says:
> 
>       DoCmd.OpenREport "MyReportName", AcPreview
> 
> (2) A more elegant solution would be to build a form that the user can
> enter the values into text boxes or drop down boxes and the report data
> source query can use them in the criteria for those fields like this:
> 
>       Forms!MyFormName.Quarter
>       Forms!MyFormName.Year
> 
> (3) Yet another way would be to build the form and have it populate a
> table.  Then in the report data source query you can link to that table
> and filter the data.  Though you may have to use VBA to clear the table
> before each use, as it would have data in it from the last run.
> (Another way to get around that would be to use the last (most recent)
> row via the MAX function, etc.)
> 
> (4) If you will only ever be running the report for the current quarter
> and year, then you can just hard code some formulas into the report data
> source.
> 
> 
> PS - Anyone know of any job openings?  ;)
> 
> -
> Peter Groman
> peter.gro...@...
> 
> 
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of dawnmahc
> Sent: Thursday, April 16, 2009 8:18 AM
> To: [email protected]
> Subject: [ms_access] Button that will open a report based on quarter and
> year
> 
> 
> 
> Hello,
> 
> I'm new to Access. I need to create a button for the end user that will
> prompt for the quarter and year, then it will pull up the report with
> that quarter and year. I have a table with qtr as the quarter and year
> as year. I've created a Form that has a button called report. Can you
> please help me?
> 
> Thank you in advance.
> 
> Dawn
>


Reply via email to