Create a Folder and sub folders

  • Thread starter Thread starter kevcar40
  • Start date Start date
K

kevcar40

Hi
I am working on a project that requires supporting documents(ie. word
/ excel files) to be stored in folders under a company name.

So you would have the folder structure of C:\ [Company name\ and under
this there eould be two folders one called Excel files the other colled
word documents.
in the Database i have a table company information Which can be
updated by multi users

Now what i want to do is when the users open the form to generate a
report on the company
he selects the compay from a combobox (Cbo_companies)

I would like to create a folder called the company name and place the
two sub folders under it
However if the folder already exists i want the data inside to remain
intact ie not create a new folder structure


Thanks


Kevin
 
Hi Kevin,

The simplest way is to use ChDir and error trapping. Try to change to the
supposedly new directory, and if it doesn't exist, then create it and its
children.

HTH
Martin
 
There is an API that does just that:

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

MakeSureDirectoryPathExists(strMyPath1)
MakeSureDirectoryPathExists(strMyPath2)

The last character in the path must be a backslash ( \ ):
strPath1 = "c:\directory1\directory2\directory3\"

Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
 
Graham
Thank you for replay
Could you please tell me where i place the function header and the
calls

thank you

kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top