Senin, 24 Juli 2017

[MS_AccessPros] Export report using a query as a filter

 

Hello all,


I have several macros that I would like to convert to VBA.

But I also am converting 4 reports to using one report and 4 different query sources. The report is a timesheet with a lot of lines and objects and controls on the report. If something changes, I have to do the same change on 4 different reports. So converting to one report and opening the report with a query filter makes more sense.

The issue I am having is the exporting the report to a folder using the query as a filter.


the open args are for the on open event to change the record source.


I converted the macro that exports the reports to a folder but there is no where to use the query to filter the report before exporting it.


I have the following to open the report

DoCmd.OpenReport "rptNonExemptTimesheets", acViewPreview, , OpenArgs:="qryNonExemptTimesheetsForPoly"


For exporting I have the following that gives me an error of Compile error:; Syntax error


       DoCmd.OpenReport "rptNonExemptTimesheets", acViewPreview, OpenArgs:="qryNonExemptTimesheetsForPoly, "PDFFormat(*.pdf)", "\\Afwfs\AF\Services\UnivSrv\Admin Services\Management Support Services\ADMINISTRATIVE SERVICES DATABASES\MANAGEMENT SUPPORT SERVICES T-A-P\ABSENCE DATABASE\Department Reports\PolyTimesheets.pdf", False, "", 0, acExportQualityPrint"



Thank You for any assistance

Jim Wagner

__._,_.___

Posted by: luvmymelody@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar