Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating automated monthly reports

Status
Not open for further replies.

dannb

Technical User
Mar 4, 2005
4
GB
Hi
i am trying to create a dynamic query that will print a monthly sales report. i am a bit stuck as to what i should put in the criteria.

for example sales between 1/1/2005 and 1/2/2006

i would be very grateful if someone could please help.
 
dannb
I am assuming that your query has a Sales Date column. If so, and you want to use specific dates as criteria, you have to enclose the dates between # signs.

An example...
Between #1/2/2005# And #1/2/2006#

The problem with this approach is that it requires constant maintenance - going into the query and changing the dates. Therefore a better approach to try would be...
1. Create an unbound form. Let's call it frmDateSelector
2. On the form put two text boxes. Let's call them txtStartDate and txtEndDate
3. Also on the form put a command button to run the report. The report will still be based on your original query.
4. In the query Sales Date column, put this as criteria...
Between Forms!frmDateSelector!txtStartDate And Forms!frmDateSelector!txtEndDate

Then you run everything from your form. Whatever dates you enter in the unbound text boxes will be the dates entered in the query criteria.

Tom
 
Thank For your help just one more thing would this criteria generate an automatic report for that month if i were to insert a command button which ran this query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top