one more piece...
does the mkdir function have the ability to see a folder exists and
if not create or if it does then use it?
I have loop that will spit files into a folder named by a var in the loop;
if the folder does not exist it bombs.
This is what I have...
Private Sub cmdExport_all_Click()
Dim sSQL As String
Dim super As String
Dim rcSet As DAO.Recordset
Dim rsTbl As DAO.Recordset
Dim db As DAO.Database
'lets get the supervisor name(s)
sSQL = "SELECT DISTINCT [Supervisor] FROM Commission WHERE IsNull([Supervisor]) = False ORDER BY [Supervisor] "
Set db = CurrentDb()
Set rcSet = db.OpenRecordset(sSQL)
rcSet.MoveLast
rcSet.MoveFirst
Do Until rcSet.EOF
DoCmd.OpenReport "Commissions", acViewPreview, , , acHidden
super = rcSet.Fields(0).Value
Reports![Commissions].Filter = "[Supervisor] = '" & super & "'"
Reports![Commissions].FilterOn = True
DoEvents 'just to put the system on hold to complete the update and other stuff
DoCmd.OutputTo acOutputReport, "Commissions", acFormatSNP, "C:\" & super & \"1.snp"
rcSet.MoveNext
Loop
DoCmd.Close acReport, "Commissions", acSaveYes
Exit Sub
End Sub
is there a way to - before the output cmd to see if the super folder exists and if not create it?
Thanks for your help.