Hi I use the following code to open a report, by entering the dates in the txtStartDate field and the txtEndDate field.
Dim stDocName As String
Dim strWhere As String
strWhere = "[Date] between #" & Format(Me.txtStartDate, "dd-mmm-yy") & "# AND #" & Format(Me.txtEndDate, "dd-mmm-yy") & "#"
stDocName = "rptSouthW"
DoCmd.OpenReport stDocName, acPreview, , strWhere
DoCmd.RunCommand acCmdZoom100
How do I get the following code below to work in the same way as the code above so that I only have to end the dates once, the reason I ask is I have several reports to export to Excel and its a pain to keep entering the date range.
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryClaimsDetail", "P:\Incident Report.xls", , "Claim Detail"
Thanks
Bob