it is like here
DoCmd.OpenReport "tempServiceReport", A_PREVIEW, , G_REP_var1
DoCmd.OutputTo OutputReport, "tempservicereport"acFormatXLS, "ServiceReport.xls",_ True
where G_REP_var1 = "InvoiceNumber >= " & invfrom & " AND InvoiceNumber <= " & invto & ""
and the report has Record Source like...