To create a directory, use MkDir.
Assuming C:\Reporting already exists, you'd use:
MkDir "C:\Reporting\" & Format(Date(), "yyyy mmm")
To move files, you use the Name statement. Unfortunately, you can't use wild
cards with the Name statement (nor with the FileCopy statement, although you
can with the Kill statement). To have a VBA-only solution to your problem,
you could use something like:
Dim strCurrFile As String
Dim strCurrFolder As String
Dim strNewFolder As String
strCurrFolder = "C:\Reporting\Data\"
strNewFolder = "C:\Reporting\2006 Jan\"
strCurrFile = Dir(strCurrFolder & "*.*")
Do While Len(strCurrFile) > 0
Name strCurrFolder & strCurrFile As strNewFolder & strCurrFile
strCurrFile = Dir()
Loop
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Paul Dennis" <(E-Mail Removed)> wrote in message
news:A1162C92-3689-4ED8-B1A4-(E-Mail Removed)...
> I am looking to create a Module in Access that will create a directory
based
> on the current month/ year and then move all files from one direct to it.
>
> ie create directory "C:\reporting\2006 Jan"
> copy "C:\reporting\data\*.*" "C:\reporting\2006 Jan"
> delete "C:\reporting\data\*.*"
>
> Do you know the syntax please?
> Also want it so it doesn't prompt for confirmation?