The required path argument is a string expression that identifies the directory or folder to be created. The path may include the drive. If no drive is specified, MkDir creates the new directory or folder on the current drive.
OR
Dim objFSO as New Scripting/FileSystemObject
objFSO.CreateFolder(foldername)
Description
Creates a folder.
Syntax
object.CreateFolder(foldername)
The CreateFolder method has these parts:
Part Description
object Required. Always the name of a FileSystemObject.
foldername Required. String expression that identifies the folder to create.
Maybe you can help me with another problem related to this one. Now that I have created a folder, I need to transferText my database tables into this folder, but when I tried to do this, I got this error message:
"Runtime error "3051"
The MIcrosoft Jet database engine cannot open the file 'cases'. It is already opened exclusively by another user, or you need permission to view its data.@@@2@5003051@2.
this is my code:
If Dir(txtFileName.Text) <> "" Then
Kill (txtFileName.Text)
End If
MkDir (txtFileName.Text)
For Each tablename In db.TableDefs
If Left(tablename.Name, 4) = "CASE" Then
DoCmd.TransferText acExportDelim, "Import Specification", tablename.Name, txtFileName.Text, 0
End If
Next
I see you made a directory with the name in
txtFileName.Text
and then use
DoCmd.TransferText acExportDelim, "Import Specification", tablename.Name, txtFileName.Text, 0
Does the Jet Engine expect a DIRECTORY name ONLY or a full Path/FileName
e.g.
txtFileName.Text & "\" & tablename.Name & ".txt"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.