Avatar of SteveL13
SteveL13
Flag for United States of America asked on

How loop through records and create folders for each record on a server drive

I have a database that contains several records related to properties.  I want to somehow run a function that will create a folder on a server drive for me for each of this properties just by clicking a button on a temporary form.

The schema for the folders on the server will be like:

Master Folder Name (to be named "Properties"
>>>>>City, State (from the property record)
>>>>>>>>>>Property Name (from the Property record)

In other words as an example like this screen shot:

Server folder example
How can this be done?
Microsoft Access

Avatar of undefined
Last Comment
SteveL13

8/22/2022 - Mon
Rey Obrero (Capricorn1)

what is the name of the table? and the fields on the table?

upload a sample db with the table.
SteveL13

ASKER
Database sample attached.
Make-Folders.accdb
Rey Obrero (Capricorn1)

what is the path to the server?
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SteveL13

ASKER
Absolutely perfect!!!  I did change one line to add the property ID and put the city and state in the folder name...

strFolder = "C:\Properties\" & rs!City & " " & rs!State & "\" & rs!ID & " - " & rs!PropertyName & "\"
SteveL13

ASKER
Absolutely amazing.  Thank you!