Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a new output folder

Status
Not open for further replies.

froag

Programmer
Aug 9, 2002
2
0
0
US
This is for saving customer info into a unique folder based on their customer number.
I need to create a new folder based on a (record) number.
Then I can output to that specific folder.

I can tweak the VB some.

Anyone??
 
The following sub will create, if necessary, a folder for you and will put you in the folder. I am assuming you already know what you are going to put in the folder and how to do it.


Public Sub sBuildFolder(PathName As String)

If Len(Dir(PathName, vbDirectory)) = 0 Then
MkDir PathName
End If
ChDir PathName



End Sub
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Hope this helps, what it does it makes a directory and gives it a name obtained from a field within a form, so I gather in your case if you have a form with a text box displaying a customer by placing the code below behind a button it would create a directory and give it the name of the current customer.

MkDir "C:\test\" & Me![customer].value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top