I am working on enhancing the database I designed. I am trying to improve speed on the code I do have by switching multiple dlookups for recordsets and building better queries and reducing the number of them that overlap. So I was wondering about exporting reports to pdf. I do this a bit with my system. The reports are opened the pdf is created and output to the location of my choice just fine and then the report closes. In the example I will provide everything works, I am just curious if all of it is needed. The database is accessed on the server and can be slow, that is why I am trying to trim down and remove anything that isn't needed. If there isn't anything I can do to speed this along, that is an acceptable answer also.
Code:
DoCmd.OpenReport "TestRequestReport", acViewPreview, , "[TRNumber]= Forms!TestRequestForm!TRNumber"
DoCmd.OutputTo acOutputReport, "TestRequestReport", acFormatPDF, ToPath & "\" & MyFileName, False
DoCmd.Close acReport, "TestRequestReport"