View Single Post
  #2 (permalink)  
Old July 6th, 2007, 05:14 AM
robzyc robzyc is offline
Friend of Wrox
 
Join Date: Mar 2007
Location: Hampshire, United Kingdom.
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi David,

You need to seperate the variables from the String, as shown below (kep points in bold)
Code:
DoCmd.OpenReport _
    stDocName, acPreview, , _
    "[IncidentMonth] Between #" & Format$(Forms![frmRunReport]![FromDate], "yyyy-mm-dd") & "# And #" & Format$(Forms![frmRunReport]![ToDate], "yyyy-mm-dd") & "# AND [Month] = #" & Format$(Forms![frmRunReport]![FromDate], "yyyy-mm-dd") & "#"
    Note, I have also formatted the dates to UDF format, and placed them in hashes (#) which is how Access recognises them as dates.

I hope this helps,

Rob
Reply With Quote