You need to automate the date criteria. Here are 2 date functions you will
need to produce a report for Last Month. Put them in a standard module:
Function BeginLastMonth() As Variant
BeginLastMonth = DateAdd("m", -1, DateSerial(Year(Date), Month(Date), 1))
End Function
Function EndOfLastMonth() As Variant
EndOfLastMonth = DateSerial(Year(Date), Month(Date), 0)
End Function
Now, in your criteria box of the query for your date report use the
expression:
Between BeginLastMonth() And EndOfLastMonth()
Each month the report will automatically get last month's data. As to when
it's run a batch file can start Access and run the report according to a
date/time set up in a scheduling program.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004