Results 1 to 4 of 4
  1. #1
    MattLopes is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    2

    Can I click a button to check a files creation date and time?

    At my job I have to generate a file on my computer and copy it to a network folder so the machine operators in the shop can access it. Sometimes I have to revise the file and I forget to copy the new version into the shared folder. This is a problem because the file that is in that folder is now the wrong file. I use an access database to print a work sheet for the operators, on which i enter the file name in a text box, not hyperlinked.



    What I would like to do on my form, is have a button next to this text field that i can click that will look in a specific folder for a file that matches that text box that I enter the file name into. I want it to check the date and time that the file was created so that i can display this info on the form. I will add some logic to check how old the file is and let the person know if the file is out of date in the network location.

    Does this sound like something that is possible to do? If so, can someone point me towards some info on how I would go about doing this? These are just text files btw if that makes any difference.

    Thanks!

    Here is a screenshot of my form that I use. The field that contains the file name I would like to check is the Tap File field. The link at the bottom is not related to this, the files I'm looking for are always in one specific folder that can be hard coded.

    Click image for larger version. 

Name:	2019-05-06 09_34_49-Access - toolprogressionFE-WIP _ Database- C__Users_mlopes_Desktop_toolprogr.png 
Views:	18 
Size:	21.5 KB 
ID:	38303

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Matt,

    Please tell us what this means
    I will add some logic to check how old the file is and let the person know if the file is out of date in the network location.

    How and why exactly does the file become out of date?
    What is/are the related business process(es) that need the latest file? What is the impact of a non up to date file?
    Have you considered using version numbers when you have multiple tap files that are/have been updated?

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It sounds like you copy a file from a network folder to your drive, modify the file it, then copy it back to the network folder. Or that is what is supposed to happen.

    You could write code to check the date and time of a file on your computer, check the date/time of the file on the network server, then compare the two dates and times.
    If this is what you want, start by looking at this site
    https://www.ozgrid.com/forum/forum/h...date-of-a-file (it is for Excel, but will work the same in Access)

  4. #4
    MattLopes is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    2
    Thanks for the input,

    I am working on this project slowly when I have spare time at work, but I have come across the FileDateTime function I am going to try out next time i work on it. I will also try out the code in the post above as it seems to have worked for that person.

    When i say I will add some logic to it I mean I will do some calculations to see how old the file is in the network location and possibly check it against the file that is on my computer. If they have different dates then the file has not been copied to the network location and will display a warning saying that the production file is out of date. I will also check if the file is a certain age and display a warning about that because there is a possibility that I also didn't update the file on my computer yet and only updated the design file. These are things I can add after, for now I just want to be able to read in the file date and have it displayed. This seems much easier once i started searching how to do this with VBA and not MS Access specifically.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 05-24-2017, 02:22 PM
  2. Time and Date on MS Access 2010 files
    By Lou_Reed in forum Access
    Replies: 4
    Last Post: 07-12-2016, 08:12 AM
  3. On Button Click, Record Date & Time to a Textbox
    By JakeMurray27 in forum Programming
    Replies: 2
    Last Post: 02-20-2016, 04:22 AM
  4. Replies: 6
    Last Post: 11-18-2013, 12:03 PM
  5. Date and time check
    By polis in forum Programming
    Replies: 2
    Last Post: 09-30-2011, 09:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums