New Folder in Existing Project Folder

RasmusElkjaer

New member
Local time
Today, 07:42
Joined
Oct 6, 2021
Messages
3
Hey Everyone

I am Currently working on a Access warranty Database, From a Excel Database, we are Folders for each Project And in that folder we have a New folder for each Claim we get so we can put relevant files in there.

i have made some code to locate the project file, but is it possible so every time i make a new claim in my form i can link to that file path and then make a new folder for the current Claim nr?

currently i have made a code with Mkdir, so it takes my project No and Name, and make a folder if there isent one, it work perfekt, but some ppl would like to point were in the project the files should be saved any ideas how to do so? tried for some time now and googled alot :)

have a nice day!

Kind regards Rasmus
 
Hi. Welcome to AWF!

Maybe you can give us some examples of the paths your users might want to create?
 
thank you all i will look more in to the linked code i got it to work as i wanted with this code for the project
Code:
Private Sub DrawingLink_Click()
  Dim f As Object
  Dim strFile As String
  Dim strFolder As String
  Dim varItem As Variant

  Set f = Application.FileDialog(4)
  f.AllowMultiSelect = False
  If f.Show Then
    For Each varItem In f.SelectedItems
        strFile = Dir(varItem)
        strFolder = Left(varItem, Len(varItem) - Len(strFile))
        MsgBox "Folder: " & strFolder & vbCrLf & _
            "File: " & strFile
        Me.MainWarrantyfolder = strFolder
     Next
  End If
  Set f = Nothing
 
End Sub
and this code when in the claim
Code:
Private Sub Create_ViewFolder_Click()

Dim strPath As String
strPath = Me.MainWarrantyfolder
                    If Len(Dir(strPath, vbDirectory)) = 0 Then
                       MkDir strPath
                     End If
                     'dir henviser til eksisteren folder hvis der ingen er laver MKdir en ny folder

strPath = Me.MainWarrantyfolder & "\" & "NCR" & Me.GlobalNCRNo
                    If Len(Dir(strPath, vbDirectory)) = 0 Then
                       MkDir strPath
                
                     End If
                     'dir henviser til eksisteren folder hvis der ingen er laver MKdir en ny folder
                    
                     Me.ClaimFolder = strPath
                    
                     Application.FollowHyperlink Me.ClaimFolder
                                

End Sub
 
Congratulations! Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom