Make folders from query

lundi 23 février 2015

Hi,

Can some one help me or direct me to an example.

I am trying to make some folders from a Query list to my C drive.

I found this code for making folders.

I have a button on a form with this code. It works with making a folder but only gives me the first item in the query out of many rows. It is missing the rest of the items.

Also I would like it to be able to make Sub Folders too from this query.

Any help would be appreciated.....



Here is the code I found.

Private Sub MakePreservationTagFolder_DblClick(Cancel As Integer)

Dim strFolder As String



strFolder = "C:\Users\bryan\Documents\" & "Tag - " & DLookup("[Tag]", "Tags Qy")



Dim fso

Set fso = CreateObject("Scripting.FileSystemObject")



'Check whether the folder exists

If Not fso.FolderExists(strFolder) Then

FileSystem.MkDir (strFolder)

MsgBox "Folder Created"



Else

MsgBox "Folder Already Created"



End If

End Sub







Thanks BBryan

Make folders from query

0 commentaires:

Enregistrer un commentaire

Labels