Results 1 to 7 of 7
  1. #1
    MWB is offline Novice
    Windows XP Access 2000
    Join Date
    Oct 2010
    Posts
    11

    Directory Creation Feature Help

    Hey guys, I was trying to implement a feature for a program I made for work, but im not sure where to even start on it.



    The program is for gathering information on new products that come out. We are going to wind up having hundreds of products, and to keep everything organized I would like to have all of the product information stored in one main parent folder. Each product in that main folder is then to be designated its own directory that is devided by three categories that include pictures, performance results, and reports

    The folder structure should look like this

    Main Folder
    Product 1
    Images
    Performance Results
    Reports
    Product 2
    Images
    Performance Results
    Reports

    and so forth.

    I would like to keep the user out of the directory in able to make the program more user friendly, and also to keep users from moving files around.

    Is there a way that I can have a command button that when pushed, will ask the user the product name, and then after doing so will copy and paste a template of the file structure shown above into the main parent directory?

    So when the user hits this command button it will promt them for a product name, say they call it "Rubber Gasket".

    Then the program will set up a directory for the user in the parent directory that looks like the following

    Main Folder
    Rubber Gasket
    Pictures
    Performance Results
    Reports

    I dont really know where to start on this, so i figured this would be a good place to look for hints that could point me in the right direction.

    Thanks for any help in advance, and sorry for the long post.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Code:
         dim pname as string
         pname = inputBox ("Product Name")
         mkdir "Main Folder\Rubber Gasket"
         mkdir "Main Folder\Rubber Gasket\Performance Results"
         mkdir "Main Folder\Rubber Gasket\Pictures"
         mkdir "Main Folder\Rubber Gasket\Reports"

  3. #3
    MWB is offline Novice
    Windows XP Access 2000
    Join Date
    Oct 2010
    Posts
    11
    Sorry im unfortunitly not too Access savy, but I think I understand the majority of that.

    So I would have to made a textbox called Product Name firstly. Then I would have to make a command button that says on click pname = [Product Name]? And then from there I can create the folders as listed below? Would modifying the code such as i did below make the sub folder match what the product name is?


    dim pname as string
    pname = inputBox ("Product Name")
    mkdir "Main Folder\[pname]"
    mkdir "Main Folder\[pname]\Performance Results"
    mkdir "Main Folder\[pname]\Pictures"
    mkdir "Main Folder\[pname]\Reports"

    Sorry agian for all of the questions. Still trying to get my bearings with access.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I am sorry, I was too rush that I forgot to change the folder name.

    you don't need to create a textbox because inputBox will pop up a window ask for input. you can only create a command button and put the codes in the click event.

    The code should like this:

    dim pname as string
    pname = inputBox ("Product Name")
    mkdir "Main Folder\" & pname
    mkdir "Main Folder\" & pname & "\Performance Results"
    mkdir "Main Folder\" & pname & "\Pictures"
    mkdir "Main Folder\" & pname & "\Reports"

  5. #5
    MWB is offline Novice
    Windows XP Access 2000
    Join Date
    Oct 2010
    Posts
    11
    Awesome, that was a lot easier then I thought. Thanks a lot man, I really appreciate it.

    One more quick question and I should be all set. Is there a way to put a copy of a master powerpoint into each sub directory each time one is created?

  6. #6
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    is "master powerpoint" a file?

    to copy a file, use following statement:
    FileCopy source, destination

    for example:
    FileCopy "......\master powerpoint", ".....\Main Folder\Rubber Gasket\Performance Results"

  7. #7
    MWB is offline Novice
    Windows XP Access 2000
    Join Date
    Oct 2010
    Posts
    11
    Yeah that's actually exactly what I wanted to do. Thanks a lot for all of the help, saved me a from having a big headache lol.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Comparison Feature Help
    By Kapelluschsa in forum Access
    Replies: 2
    Last Post: 10-25-2010, 06:43 AM
  2. Help with a search feature or combo box
    By jmanis in forum Forms
    Replies: 14
    Last Post: 07-06-2010, 06:38 AM
  3. Make directory or folder
    By thart21 in forum Programming
    Replies: 1
    Last Post: 04-07-2010, 05:37 PM
  4. New directory with the name from field
    By np1111 in forum Programming
    Replies: 14
    Last Post: 02-25-2010, 07:06 AM
  5. Replies: 5
    Last Post: 06-17-2009, 02:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums