Folder names from Access field

E

EllenM

Hello,
I have an Access field that I'd like to be the names of folders. Is there
an easy way to do this? Or would it need to be done one by one?

Thanks,
Ellen
 
D

DL

You really need to explain in more detail as to what 'names of folders'
means exactly, and in what context you are using this, eg Acess form or?
Then probably post to an Acess group, & give your version
 
E

EllenM

Hi DL,
The names happen to be an Access, they could be in Excel. Just want a
folder for each entry in the field.

Ellen
 
B

Beth Melton

EllenM said:
Hi DL,
The names happen to be an Access, they could be in Excel. Just want a
folder for each entry in the field.

you can loop through each record in the table and create a folder using the
data value in the field. It'd be something like:

Sub MakeFolders()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Dim strSql As String
Set rs = New ADODB.Recordset
strSql = "Select FolderNameField from Table"
rs.Open strSql, cn
Do Until rst.EOF
MkDir rs.Fields("FolderNameField")
rs.MoveNext
Loop
End Sub

If you're not sure what to do with the code or how to modify it to fit your
needs then you may want to ask in one of the Access programming (VBA)
newsgroups and perhaps someone there can help you out.

--
~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
https://mvp.support.microsoft.com/profile/Melton
What is a Microsoft MVP? http://mvp.support.microsoft.com/gp/mvpfaqs

Guides for the Office 2007 Interface:
http://office.microsoft.com/en-us/training/HA102295841033.aspx
 
E

EllenM

Thanks, Beth. I actually know someone that can help me with this script.
Thanks so much!!
 
B

Beth Melton

EllenM said:
Thanks, Beth. I actually know someone that can help me with this script.
Thanks so much!!

Good to hear! If you/they get stuck you can post back here too but in an
Access group you're more likely to find more folks who are familiar with VBA
and obtain a faster response. :)
--
~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
https://mvp.support.microsoft.com/profile/Melton
What is a Microsoft MVP? http://mvp.support.microsoft.com/gp/mvpfaqs

Guides for the Office 2007 Interface:
http://office.microsoft.com/en-us/training/HA102295841033.aspx
 
Top