Hi,
I am using a module right now to export a report into a folder right now using the "Medium date format to rename the file. I was wondering if at the same time I could also creae a folder by the days "medium date" for that file to go into. here is the code that I am using right now,
I hope that this is possible
Thank you in Adavance,
Matthew Trant
The Eastern CT Business Consultants
I am using a module right now to export a report into a folder right now using the "Medium date format to rename the file. I was wondering if at the same time I could also creae a folder by the days "medium date" for that file to go into. here is the code that I am using right now,
Code:
Public Function DoesFileExist(PathStrg As String) As Boolean
On Error Resume Next
If Len(Dir(PathStrg, 14)) > 0 Then DoesFileExist = True
If Err <> 0 Then Err.Clear
End Function
Public Sub Inventory_Report_Save()
'By Matthew Trant
Dim FilePathStrg As String
Dim FileNameStrg As String
FilePathStrg = "[URL="file://webserver1/Webs/Lori/Inventory"]\\Webserver1\Webs\Lori\Inventory[/URL] - "
FileNameStrg = Format(Now, "Medium Date") & ".html"
If DoesFileExist(FilePathStrg & FileNameStrg) = True Then
If MsgBox("The file name '" & FileNameStrg & "' already exists." & vbCr & _
"Do you want To Overwrite it?", vbExclamation + vbYesNo, _
"File Already Exists...") = vbYes Then
Kill FilePathStrg & FileNameStrg
Else
Exit Sub
End If
End If
DoCmd.OutputTo acOutputReport, "InventoryValue", acFormatHTML, FilePathStrg & FileNameStrg, False
End Sub
I hope that this is possible
Thank you in Adavance,
Matthew Trant
The Eastern CT Business Consultants