troubleshooting Question

How create a folder on a server with the PK as the folder name

Avatar of SteveL13
SteveL13Flag for United States of America asked on
Microsoft Access
8 Comments2 Solutions243 ViewsLast Modified:
I have a main form (the first form that opens with this onload event:

Private Sub Form_Load()
On Error GoTo Err_Form_Load

    Dim strAttachmentDirectory As String
    strAttachmentDirectory = DLookup("AttachmentDirectory", "LOCALtblDatabaseSetup")
    If Not Right(strAttachmentDirectory, 1) = "\" Then strAttachmentDirectory = strAttachmentDirectory & "\"
    TempVars!strAttachmentDirectory = strAttachmentDirectory

    Exit Sub

    MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Description: " & Err.Description & vbCrLf & "Error Source: " & Err.Source
    Resume Exit_Form_Load
End Sub

Which I believe is establishing the name of the folder I want on the C: drive.

But then within that established folder I want another folder to be setup using the PK on another form when a command button is clicked AND have an explorer window open to that newly established folder.  So there will end up being separate folders for each PK.  

If the folder was already setup by a previous onclick event I want the explorer window to open to it.

How can I do this?
Join our community to see this answer!
Unlock 2 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros