Hi all
I hope someone can help me. I need to make some reports out of access, and store them on a network share under a specific report ID. This means that once I have the Report Id I want to create the folder with the ID name and later in the flow I want to dump different extracts to that folder.
Is this possible ? and if yes, can you give me advice as to how I do it ?
Have tried the Run Command OutputTo, but that doesnt seem to have the flexibility of creating a folder with different names....
Thanks in advance
Best regards
Ingrid
Hi
There two way I know of creating new directories (there may be more?)
1) Use the MkDir strPath command (just type MkDir in the Access help search box)
eg If Dir(strPath, vbDirectory) = "" Then MkDir strPath
2) Use the FileSystemObject
This Object has comprehensive properties/methods for almost everything to do with the computer file system (like it says on the tin!).
You can either set a reference to the 'Microsoft Scripting Runtime' object library (this will give you access to Properties/Methods List as you write code - early binding - best if you are not familiars with the object(s))
Dim fso as FileSystemObject
Dim fsoFolder as Folder
Set fso = new FileSystemObject
OR you can create an object in code ie
Dim fso As Object
Dim fsoFolder as Object
Set fso = CreateObject("Scripting.FileSystemObject")
Then you can use staments like
If Not fso.FolderExists(strPath) Then Set fsoFolder = fso.CreateFolder(strPath)
where strPath is a variable with the required directory path
HTH
MTB