I currently have an invoice report that runs through my database which is e-mailed to clients (automatically through vba), and then saved to a specific file path.
I'm currently having an issue with the saving part of the process with certain clients who have illegal characters in their names - for example, "Client / Other Information" where the '/' is causing the save to fail.
I'm trying to find a way to change the file name of the save file for clients with these illegal characters in their names. I would prefer not to take only part of the name (as some clients are listed as "Town/Village of...") but if there is no other way then there is no other way.
The code I'm currently using is as follows:
Dim strFilePath as String
strFilePath="C:\Users\" & Environ("UserName") & "\Desktop\New Invoices\" & Me.Client.Value & ".pdf"
docmd.OutputTo acOutputReport, , "PDFFormat(*.pdf)", strFilePath, False, "", 0, acExportQualityPrint
Thanks in advance for any help you can give!