Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display File Date (Access 2002)

    Is there a way to capture and display on a form screen, the DOS date modified (displaying date and time) of a file to which I am linked in Access?
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Display File Date (Access 2002)

    Hello Judy,

    What kind of file? Another Access database, or a text file, or ...?

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display File Date (Access 2002)

    It is a .dbf file for student attendance aggregation. The Access user is linked to this file. The user needs to know the file date to see if the aggregation file contains data from the current date. If I can do that then I can use code to see if the user is trying to run a report for a date greater than the date the .dbf aggregation file was last run.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Display File Date (Access 2002)

    You can put the following function in a module:

    Function GetModDate(Filepath As String) As Date
    GetModDate = CreateObject("Scripting.FileSystemObject").GetFile (Filepath).DateLastModified
    End Function

    You can then put a text box on your form with control source

    =GetModDate("CBaseTest.dbf")

    with the appropriate path/filename substituted. You can also use the function in your VBA code.

  5. #5
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display File Date (Access 2002)

    Just be aware that compacting the file resets the file date/time.
    You might be better off using a separate table with a date/time stored in, which is updated through code.

    Just a thought.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  6. #6
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display File Date (Access 2002)

    I tried your instructions and they worked perfectly. You are the greatest. I looked everywhere I could think for an answer before posting the question.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  7. #7
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display File Date (Access 2002)

    I tried compacting the front end of my Access database and the file date remained the same for my linked .dbf file. Compacting did not change the DOS file modification date.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

Posting Permissions

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