MkDir to create multiple folder and subfolder

sheng wee
sheng wee used Ask the Experts™
on
how do I create "Commercial" & "Deployment" as subfolder for specific folder name based on some textbox value.

Private Sub Command58_Click()

filename = filenametxt.Value
MkDir "c:\AccessDatabase\" & Me.filenametxt.Value
MkDir "c:\AccessDatabase\" & Me.filenametxt.Value \ Commercial
MkDir "c:\AccessDatabase\" & Me.filenametxt.Value \ Deployment

What should I add in the codes
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Team Lead
Commented:
try:

filename = filenametxt.Value
MkDir "c:\AccessDatabase\" & Me.filenametxt.Value
MkDir "c:\AccessDatabase\" & Me.filenametxt.Value & "\Commercial"
MkDir "c:\AccessDatabase\" & Me.filenametxt.Value & "\Deployment"

Open in new window

Top Expert 2016

Commented:
this should do it

Dim filename As String
filename = Me.filenametxt
MkDir  "c:\AccessDatabase\" & filename
MkDir  "c:\AccessDatabase\" & filename & "\Commercial"
MkDir  "c:\AccessDatabase\" & filename & "\Deployment"

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial