• File Size of Particular Query Field

    Author
    Topic
    #491504

    Hi,

    I have a particular query “qryWPropertyList” whereby I have a field of ‘PicFile’ which stores the file path of an image file.

    What I need to retrieve as part of the query is to display the file size of that file in the location stored within the field of ‘PicFile’

    How can I go about this?

    Viewing 0 reply threads
    Author
    Replies
    • #1417324

      Luke,

      I’m not exactly sure what you want but here is one option.

      Create a User Defined Function (UDF) in a VBA Module.

      Code:
      Function lGetFileLength(zFilePathName As String) As Long
      
        lGetFileLength = FileLen(zFilePathName)
        
      End Function
      

      You can then use it in your query:

      MyFileLen: lgetfilelength(“G:BEKDocsExcelVBAVBA – Shift Key Test.txt”)

      Of course you’ll replace the file spec with a reference to the field containing that data in your query.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    Viewing 0 reply threads
    Reply To: File Size of Particular Query Field

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: