Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / December 2005

Tip: Looking for answers? Try searching our database.

MKDIR Limitations

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 09 Dec 2005 03:57 GMT
This statement works
MkDir Path & Me.[Last Name] & "_" & Me.[First Name]

But this one does not.
MkDir Path & Me.[Last Name] & "_" & Me.[First Name] & "\" & Me.Class

Is there a limit to how many levels I can go using mkdir statement?  Or am I
just not seeing something?
If there is a 1 folder limit, any suggestions to make a director 2 levels
down?

Signature

David

Ken Snell (MVP) - 09 Dec 2005 04:45 GMT
MkDir works only to make a subfolder within the current folder. Use ChDir to
move to the desired folder and then make a folder within it.

Signature

       Ken Snell
<MS ACCESS MVP>

> This statement works
> MkDir Path & Me.[Last Name] & "_" & Me.[First Name]
[quoted text clipped - 7 lines]
> If there is a 1 folder limit, any suggestions to make a director 2 levels
> down?
Douglas J. Steele - 09 Dec 2005 12:13 GMT
As Ken says, MkDir can only create one level of folder at a time.

Randy Birch shows a couple of techniques to extend this at
http://vbnet.mvps.org/code/file/nested.htm

(Obligatory note: Randy's site is aimed at VB programmers. There are
significant differences in the controls available for forms in VB vs. those
available in Access. Consequently, GUI-related code in his examples don't
always port exactly to Access. This example is one of those cases: he's
manually adding items to a listbox, and that won't work in most versions of
Access)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> This statement works
> MkDir Path & Me.[Last Name] & "_" & Me.[First Name]
[quoted text clipped - 7 lines]
> If there is a 1 folder limit, any suggestions to make a director 2 levels
> down?
Graham R Seach - 09 Dec 2005 12:31 GMT
David,

There is an API that will create the entire path for you in one go.

Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal
lpPath As String) As Long

For example:
   MakeSureDirectoryPathExists "c:\this\is\a\test\directory\"

...will create all the directories in the specified path, beginning with the
root.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

> This statement works
> MkDir Path & Me.[Last Name] & "_" & Me.[First Name]
[quoted text clipped - 7 lines]
> If there is a 1 folder limit, any suggestions to make a director 2 levels
> down?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.