Hello Rich
Having said that your code worked a treat, that was when I was on my 'other' PC: now I'm back on the main PC it won't work!!
The code I now have is:
Public Sub MakeFolders()
Dim sFolder As String
Dim rst As DAO.Recordset
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set rst = CurrentDb.OpenRecordset("practices")
Do While Not rst.EOF
sFolder = rst![prac name]
Set f = fs.CreateFolder("C:\Clients\" & sFolder)
rst.MoveNext
Loop
rst.Close
Set f = Nothing
Set rst = Nothing
Set fs = Nothing
End Sub
... and this keeps giving me:
Run-time error 52
Bad command or file number
with the following line:
Set f = fs.CreateFolder("C:\Clients\" & sFolder)
highlighted in yellow.
I even tried using:
Set f = fs.CreateFolder("C:\" & sFolder)
for the destination, but got the same result.
Hope you can advise.
Many thanks
Les
I see in the other branch of this thread that there was a "." in one of
the names. Did that fix the problem here? I couldn't reproduce the
error on my machine, with various folder names, with or without periods.
Rich.