- Local time
- Today, 11:11
- Joined
- Feb 19, 2002
- Messages
- 45,792
You can let them enter a file name if they really need to but NOT the way you are doing it.
You concatenate the name of the directory chosen by the picker with the file name:
Me.FullName = Me.txtDirectory & "\" & "Invoice_" & Me.CustShortName & "_" & Format(Me.InvoiceDT, "yyyymmdd") &".pdf"
Then use Me.FullName in the OutputTo.
Instead of using "Invoice_", you can let them choose the file name but I'm not sure why you think this is a good idea. Users are notorious for using bizarre names and poor directory structures. Therefore, I almost always control both within reason.
For invoices, for example, I would probably create a structure on the server that organized them. Then I would find a place to define the name of the folder and just use that as the highest level. A lower level might be CustShortName or 202211 for november. Those two would be generated on the fly and if the subfolders didn't already exist, I would create the subfolders.
You concatenate the name of the directory chosen by the picker with the file name:
Me.FullName = Me.txtDirectory & "\" & "Invoice_" & Me.CustShortName & "_" & Format(Me.InvoiceDT, "yyyymmdd") &".pdf"
Then use Me.FullName in the OutputTo.
Instead of using "Invoice_", you can let them choose the file name but I'm not sure why you think this is a good idea. Users are notorious for using bizarre names and poor directory structures. Therefore, I almost always control both within reason.
For invoices, for example, I would probably create a structure on the server that organized them. Then I would find a place to define the name of the folder and just use that as the highest level. A lower level might be CustShortName or 202211 for november. Those two would be generated on the fly and if the subfolders didn't already exist, I would create the subfolders.