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?