G
Guest
You can get quarterly reports in Access, but I need to make one that I can
call up any quarterly report from a menu. Thanks
call up any quarterly report from a menu. Thanks
David C. Holley said:Sounds like you'll need end up using a variant of the ever popular QUERY
BY FORM. If your not familar with QBF, it is a technique that uses an
unbound form to capture the criteria for a query (or in this case a
report) and then execute the query or preview/print the report. I'm
thinking that you'll have two comboboxes or listboxes - one for the year
and one for the specific quarter. I would populate the quarter control
in the following manner...
1st Quarter (Jan-Mar)
2nd Quarter (Apr-Jun)
3rd Quarter (Jul-Sept)
4th Quarter (Oct-Dec)
or using whichever months apply to your organizations specific fiscal
year. The months would be a nice to have for those users not familar
with which quarter is which.
From there, you would add two buttons - PREVIEW and PRINT with the code
call runReport(acViewPreview) or call runReport(acViewNormal)
Sub runReport(strMode as string)
[Code to build the strWhereStatement variable here. You'll want to
verify that a selection has been made in both the YEAR & QUARTER
controls AND that the QUARTER requested is VALID. If the data is present
day to past, the user should not be able to select a future quarter
since there would be no data returned. You would also build the
strOpenArgs here so that YEAR/QUARTER information can appear on the
report see below.]
DoCmd.OpenReport reportName, strMode, , strWhereStatement, strOpenArgs
end sub
By putting a control in the report's header, you can provide your users
with information about the reports content.
Sub report_open()
If isNull(strOpenArgs) = false then
[Reports]![reportName]![control in header] = strOpenArgs
end if
end sub
Yes David, I can get it to print out every quarter that I have, but I want to
select what quarter to get.
Thanks.
: