You could use a function such as:
'---------------------------------------------------------------------------------------
' Procedure : GetFileSize
' Author : CARDA Consultants Inc.
' Website :
http://www.cardaconsultants.com
' Purpose : Determine the size of a specified files (in Bytes)
' Copyright : The following may be altered and reused as you wish so long as
the
' copyright notice is left unchanged (including Author, Website
and
' Copyright).
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' strFile Path & Full Filename of the file to retrieve the file info about
'
' Usage Example:
' ~~~~~~~~~~~~~~~~
' GetFileSize("C:\Temp\Dataset.xls")
'
' Revision History:
' Rev Date(yyyy/mm/dd) Description
'
**************************************************************************************
' 1 2008-Oct-09 Initial Release
'---------------------------------------------------------------------------------------
Function GetFileSize(strFile As String)
Dim oFSO As Object
Dim oF As Object
On Error GoTo Error_Handler
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oF = oFSO.GetFile(strFile)
GetFileSize = oF.Size
Set oF = Nothing
Set oFSO = Nothing
Exit Function
Error_Handler:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf &
"Error Number: " & _
Err.Number & vbCrLf & "Error Source: GetFileSize" & vbCrLf & "Error
Description: " & _
Err.Description, vbCritical, "An Error has Occured!"
Exit Function
End Function
and use it like:
GetFileSize(application.CurrentDb.Name)
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples:
http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.