I thought VBA code couldn't be used in sharepoint, just embedded macros and the like.
But why are you trying to preview and export the file then close the file
Code:
DoCmd.OpenReport "DailyReportPrint", acViewPreview
DoCmd.OutputTo acOutputReport, "DailyReportData", acFormatPDF, MyPath & MyFiLeName, False
DoCmd.Close acReport, "DailyReportPrint"
This looks like you're opening it in print preview, then exporting it, then closing the file, which, theoretically would give you just the run time of the query on the export to view the report.
Code:
DoCmd.OutputTo acOutputReport, "DailyReportData", acFormatPDF, MyPath & MyFiLeName, False
This should be the only line you need