by MYLE
18. June 2010 21:16
Some handy function
Function ReportFolderStatus(fldr) As Boolean
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
ReportFolderStatus = True
Else
ReportFolderStatus = False
End If
Set fso = Nothing
End Function
Function CreateFolder(FolderName)
On Error Resume Next
Dim fso, f
If Not ReportFolderStatus(FolderName) Then
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(FolderName)
End If
Set fso = Nothing
End Function
Sub SaveAction(FullPathFile, FeildName, strEntry, Deleteit)
'write the data to a log file
If Deleteit And ReportFileStatus(FullPathFile) Then Kill FullPathFile
Dim strErrMsg, f, fsoLog
Set fsoLog = CreateObject("Scripting.FileSystemObject")
Set f = fsoLog.OpenTextFile(FullPathFile, 8, True, -2)
Outline = FeildName & ":" & strEntry
f.WriteLine Outline
f.Close
Set fsoLog = Nothing
End Sub
Function ReportFileStatus(filespec)
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
ReportFileStatus = True
Exit Function
Else
ReportFileStatus = False
Exit Function
End If
Set fso = Nothing
End Function
05236a39-aec2-4b3d-b4fa-8b8c433f8cc2|0|.0
Category: MSaccess, VB
Tags: