Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File Size of Particular Query Field

    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?
    Best Regards,

    Luke

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    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:\BEKDocs\Excel\VBA\VBA - 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
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •