Results 1 to 5 of 5
  1. #1
    JGrots is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jan 2013
    Posts
    65

    VBA Code for Creating a Folder within an already Created Folder

    Hi,

    I want to use a command button to create a folder within a folder that I had already created using a field's name as the name of the folder. This is what I have so far:

    Public Sub Command68_Click()

    Application.FollowHyperlink Path
    Application.FollowHyperlink "\\CEP-FS1\Shared\Project Tracker\" & ProjNum.Value & "-" & ProjName.Value

    If Len(Dir("\\CEP-FS1\Shared\Project Tracker\ProjNum.Value & "-" & ProjName.Value\" & "Meeting Minutes", vbDirectory)) = 0 Then
    MkDir ("\\CEP-FS1\Shared\Project Tracker\ProjNum.Value & "-" & ProjName.Value\" & "Meeting Minutes")
    End If

    End Sub

    So, the first part of the code works great. It opens up the folder (\\CEP-FS1\Shared\Project Tracker\P13001-Overall Equipment Effectiveness (OEE) for Production). But the second part of the code (the IF clause) I keep getting an error saying "Type Mismatch". I don't know what I'm doing wrong. I want the path to look like this: \\CEP-FS1\Shared\Project Tracker\P13001-Overall Equipment Effectiveness (OEE) for Production\Meeting Minutes

    I want to be able to create a meeting minutes folder within each project's project folder which has already been creating using a different command button.

    Any help or ideas would be greatly appreciated. Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You're concatenation of the form control and fixed text is off. It's correct in the working part.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JGrots is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jan 2013
    Posts
    65
    I'm not sure what that means. Would you be able to explain this in more detail?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What if I put them together, good then bad:

    "\\CEP-FS1\Shared\Project Tracker\" & ProjNum.Value & "-" & ProjName.Value
    "\\CEP-FS1\Shared\Project Tracker\ProjNum.Value & "-" & ProjName.Value\"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Would a filesystem watcher help out in this instance? just a thought.

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

Similar Threads

  1. creating folder from Ms access in outlook
    By capitala in forum Programming
    Replies: 5
    Last Post: 03-08-2013, 10:05 PM
  2. Replies: 21
    Last Post: 08-20-2012, 11:59 PM
  3. open folder/Make new folder(example)-VBA Code
    By Madmax in forum Code Repository
    Replies: 3
    Last Post: 03-13-2012, 09:17 AM
  4. Enter a folder name and open that folder
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 09-05-2010, 04:39 PM
  5. Creating Viewport into a folder
    By dragondata in forum Access
    Replies: 2
    Last Post: 03-26-2010, 07:15 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