Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2006-04-23
Medium Priority
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

EDDYKT earned 2000 total points
ID: 16524127
may be just

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

Author Comment

ID: 16527232
That works great. Thanks

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

572 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