View Single Post
  #7 (permalink)  
Old July 8th, 2007, 11:31 PM
David Coulter David Coulter is offline
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gentlemen,
Thanks for your responses.
If I leave out the reference to [Month] and concentrate on (my original) where [IncidentMonth] is a date -
DoCmd.OpenReport stDocName, acPreview, , "[IncidentMonth] Between Forms![frmRunReport]![FromDate] And Forms![frmRunReport]![ToDate]"
I get a report with a page for each month (12 pages for a year).
If I use Rob's suggestion -
DoCmd.OpenReport _
    stDocName, acPreview, , _
    "[IncidentMonth] Between #" & Format$(Forms![frmRunReport]![FromDate], "yyyy-mm-dd") & "# And #" & Format$(Forms![frmRunReport]![ToDate], "yyyy-mm-dd") & "#"
I get exactly the same result.
If I use Serrano's suggestion -
DoCmd.OpenReport stDocName, acPreview, , _
    "[IncidentMonth] Between #" & Forms.frmRunReport.Form.FromDate & "# And #" & Forms.frmRunReport.Form.ToDate & "#"
I get a report with 8 pages ... the last 4 pages don't print?????????
If I use the criteria for [IncidentMonth] Between [FromDate] And [ToDate] in each query and manually insert the values at report run time I get a one page report which is what I want. Why the difference?

Reply With Quote