You can create a new folder from VBA using the MkDir statement. See: docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/mkdir-statement
Good video. Need help on the same bases. I want to make a letter for each client and save each pdf in a folder. Letter will contain sane message but will have fields data such as price etc
thank you philipp does the form/report need to be continuous?, just wish you could include the table and report accdb file so we can work along with you. some of us are not as advanced as others in access. do you have a video on creating a report with a value from str?
Hi, Philipp, many thanks for posting this very helpful video. I'm using this technique but I have a problem which has me stumped - I wonder if you could help. When trying to create a PDF from a report, if I use the DoCmd.Outputto statement on its own, the PDF of the full report is created fine. However, if I open the filtered report first, when the Outputto statement is executed Access puts up a message box saying it is creating the PDF but then just closes and tries to reopen, prompting to save a backup file. A zero length .tmp file is created in the target directory. I have the exact same code running fine on another Access database on the same PC. I'm using the latest version of Access (Access v16.0 Object Library). If you or anyone has any suggestions I would be most grateful.
You would need to pass the actorId as an argument to the procedure. Then include it in the file name (to make that unique) and use it to filter the report by the actorId. This would export one report per actor. You finally would call this procedure for all the actors you want to print/export.
how do I add a combobox cbview to filename Const FILENAME As String = "D:\access\wam\TEMP\FOUTCOUNT-" & Me.CBVIEW & ".PDF" the output is wrong FOUTCOUNT-'Me.CBVIEW'.PDF tried Const FILENAME As String = "D:\access\wam\TEMP\FOUTCOUNT-" & "Me.CBVIEW" & ".PDF"
That can caused by an error in your report or the underlying query. Does the report open without problems on its own? If you can't find an error with report, check output file path. Is the path correct and does the current user have write permission for that file system directory?
6 years later and this is still saving projects. Hooray!
Yikes! Time flies...
This made life easy for me today, you sir, are a prince among men!
Super helpful, this worked perfectly for me and solved a big problem printing to correct PDF writer.
I was seriously about to just try this in the hope that it would work and Googled up your video. Now I know that it will. Excellent.
The best video tutorial I have seen. Very clearly explained and simple! Thank you
hello brother, this is exactly what I was looking for, it saved my project! Thank you very much! You have gained a subscriber.
Hi Philipp, you're just amazing !!!! You've made my day ! Great tip you provide us, thanks a lot
Thank you
But if I want to save the report in a folder that dos not exist, and want access to create that folder?!
You can create a new folder from VBA using the MkDir statement. See: docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/mkdir-statement
Great article Philipp. Thanks
Hi Philipp: Thanks for making this available - I found it very helpful for my project.
Regards. . .
Thanks so much 👍
i used your method to export report to xlsx
Good video. Need help on the same bases. I want to make a letter for each client and save each pdf in a folder. Letter will contain sane message but will have fields data such as price etc
Thank you so much
thank you philipp does the form/report need to be continuous?, just wish you could include the table and report accdb file so we can work along with you. some of us are not as advanced as others in access. do you have a video on creating a report with a value from str?
Thank you
Hi, Philipp, many thanks for posting this very helpful video.
I'm using this technique but I have a problem which has me stumped - I wonder if you could help. When trying to create a PDF from a report, if I use the DoCmd.Outputto statement on its own, the PDF of the full report is created fine. However, if I open the filtered report first, when the Outputto statement is executed Access puts up a message box saying it is creating the PDF but then just closes and tries to reopen, prompting to save a backup file. A zero length .tmp file is created in the target directory.
I have the exact same code running fine on another Access database on the same PC. I'm using the latest version of Access (Access v16.0 Object Library).
If you or anyone has any suggestions I would be most grateful.
what if I had a list of actors and would like to dynamically export each actor in one PDF page
You would need to pass the actorId as an argument to the procedure. Then include it in the file name (to make that unique) and use it to filter the report by the actorId. This would export one report per actor. You finally would call this procedure for all the actors you want to print/export.
@@codekabinettcomen wonderful clip, thanks! Do you have some code or separate clip to explore this idea please Phillip?
how do I add a combobox cbview to filename
Const FILENAME As String = "D:\access\wam\TEMP\FOUTCOUNT-" & Me.CBVIEW & ".PDF"
the output is wrong FOUTCOUNT-'Me.CBVIEW'.PDF
tried Const FILENAME As String = "D:\access\wam\TEMP\FOUTCOUNT-" & "Me.CBVIEW" & ".PDF"
Thanks Philipp. Helps a lot! :)
Thank you very helpful
Thanks a lot.
SHOWWW, GOSTEI
How to Export Access Report to JPG?
I'm afraid it's not possible to export a report to JPG.
DoCmd.OuputTo returns error 2501 “OutputTo action was cancelled”.
That can caused by an error in your report or the underlying query. Does the report open without problems on its own?
If you can't find an error with report, check output file path. Is the path correct and does the current user have write permission for that file system directory?