filter for printing multiple reports

nanny

Registered User.
Local time
Today, 14:36
Joined
Dec 16, 2008
Messages
19
I found some wonderful advise on printing multiple reports (edit code behind print button), but I need to take it a step further. I need to add a date range for the reports to print. I did this in the query under [AuditDate] and it's fine when I print one report, but when using the print all button it prompts me for a date range for each report (there are about 14, yes fourteen, to print). I am self taught and do not know how to write code. I know what I need to tell the computer--just not how .
 
Mr. Larson will I need to replace any of your expression with my information??? Do I need to start from a table then query then form??? Between [Forms]![frmReportDates]![txtBegDate] And [Forms]![frmReportDates]![txtEndDate]
 
You can create a form named frmReportDates (or just import the one I have in the sample) and then you want to substitute the expression Between [Forms]![frmReportDates]![txtBegDate] And [Forms]![frmReportDates]![txtEndDate] for the criteria for [AuditDate] in the query/queries that you are using.
 
I copied your example, but the open report only let me choose one report to open/print. I was hoping to print all reports that fall within a date range.
 
All you have to do is to modify the code to open the reports you want:
Code:
With DoCmd
   .OpenReport "rptReportTest", acViewPreview
   .OpenReport "YourNextReport", acViewPreview
   .OpenReport "YourThirdReport", acViewPreview
   .OpenReport "YourFourthReport", acViewPreview
End With
 
I understand--thanks, but do I have to open the reports before I can print them??
 
Still not working. I copied and pasted your code and then substituted my form names as appropriate. Do I need to create a query of the audit dates? Thanks again for your help--not a lot to work with on this end--even so----Thank you.
nanny
 
Hello again Mr. BobLarson
I finally got the reports to print using your form and modifying the code. I have 14 reports total that print. The only problem I am having now is three of the reports do not print the data they are suppose too. Any Ideas??? Thanks for your help.
Slow but Sure-----Nanny
 
Unfortunately I wouldn't have a clue. And right now I just don't have the time to be looking at the actual database.
 
I went back and looked at all my reports. The dates on the three reports were not formatted the same as all the other reports. Correcting that made all the reports print correctly. You have been a great help and I appreciate it.
 
I went back and looked at all my reports. The dates on the three reports were not formatted the same as all the other reports. Correcting that made all the reports print correctly. You have been a great help and I appreciate it.

thumbsup.png
 
Bob,

I have been after something like this myself and stumbled across this thread. Great....but one question.....

If i wanted the "End Date" to default to today then i put =Date() in the default value property, this works OK....

..but if i wanted the "Beginning Date" to default to the earliest date available in a particular query then how would i do that ?

Thanks in advance for any help.

John
 
bob isnt here anymore

simplest way is just to say

startdate=0

you dont need to find out what the earliest date actually is.
 

Users who are viewing this thread

Back
Top Bottom