(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
[email protected]
-----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