Hello'
I have all the date fields in an app set to use the ISO format for short (numeric only) dates. Everything is fine on the forms & reports (regardless of your settings, they are YYYY-MM-DD (as it always should be for numeric only dates ).
During a specific report export I am copying a date field via VBA to apply it to the file name of a export.
This works fine when the PC is also set to use the ISO format for numeric dates but fails me when any other regional settings is present. e.g. My 2015-07-15 gets converted into 07/15/2015 or 15/07/2015 or other...
Obviously this is a fail for file names... When this occurs, the end users apparently cannot even change the file name (to remove the "/" symbol as I am getting error 2302 every time I try).
When I am copying the date via VBA from a field with a YYYY-MM-DD format / YYYY-MM-DD input mask; how do I retain/force the source field's format / input mask?
'Prep the Report Range Section of the File Name
Dim strRepStart As String
Dim strRepEnd As String
strRepStart = Me.txtFLTRStartDate
strRepEnd = Me.txtFLTREndDate
'TRIM strRepEnd
strRepEnd = Left$(strRepEnd, 10)
strFileName = "ReportName" & "_" & strRepStart & "-" & strRepEnd & ".pdf"