Using the fso filesystem commands how can I make the focus return to the newly created folder

Posted on 2006-04-23
Last Modified: 2010-05-01

I have a form that open a form asking for a name for a new folder. ONce the name is entered a new folder is created in the location selected from the previos form. I use the following

Dim folder As String
Dim location As String
Dim fso As New FileSystemObject
folder = frmnewfolder1.txtfolder.text
location = frmfootwearloc.dircontrol4
On Error GoTo ref:

If Len(txtfolder.text) <= 0 Then
    MsgBox text(1053), vbExclamation
     Exit Sub
fso.CreateFolder location & "\" & folder


Unload Me

End If

This works and creates a new folder, but the focus in the previous form remains in the box refreshed but it does not highligh the newly created folder. I also need the text box in this form to update with the new file path. Any help appreciated.
Question by:eneate
    LVL 26

    Accepted Solution

    may be just

    frmfootwearloc.dircontrol4.Path = location & "\" & folder

    Author Comment

    That works great. Thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now