Results 1 to 8 of 8
  1. #1
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    153

    File Not Found

    I write this mainly as a guide to others, but also in the hope that someone has a better answer.


    I maintain a very large accdb/mdb application. I use Access 2016 (Windows 10) on a development machine and deploy updated versions to 2 production PCs on a regular basis.
    Whenever I make changes I do it in very small steps and create numbered versions for each small change (I am currently up to version 658)

    Occasionally (far more often than I would like) the latest version will throw the "File Not Found" error and the version is unusable.
    So I mark the latest version as "Duff" and regress to the previous working version and then reapply the changes (code and or design) and call it "latest version Mark2" and it works!!!

    Each time this happens I try without success to diagnose the error. Sometimes the Debug/Compile shows a compilation error - mostly it doesn't. I have found nothing else and certainly no indication of which File is missing.
    Even more worrying is that sometimes the code on the development PC works fine, but when deployed to a production PC (in exactly the same way as ever) the production PC throws File Not Found. Again the regress/reapply changes (on the development PC and redeploy fixes it.
    One minor clue is that it seems to happen if whilst creating the new version I have used debug and stepped through the new code (or old code) looking for an issue. I always remove the break points before deployment but perhaps some remnant of the debugging is left behind (just a theory which I can't prove)

    So the answer is baby steps and keep a careful records of changes at every (small) step and be prepared to regress/reapply.

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Have you decompiled and recompiled?
    Guide here: http://www.fmsinc.com/MicrosoftAcces.../Decompile.asp, or alternatively (and possibly better) imported all the objects into a fresh new database?

    It sounds like you have some underlying corruption somewhere, and it can be very difficult to track down.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You shouldn't be having that problem, and fixing that would be better than managing it on an on-going basis. Some thoughts:
    - decompile then recompile as suggested
    - it seems you don't know what file is being referred to in the error. If the fe opens then it may be the be. Try refreshing the links.
    - does code run (by autoexec or default opening form) and does it refer to a file in any way? Auto loading form may be corrupt.
    - you say sometimes you get a compile error. Where? If in a form module but you can't see what causes the error, that form or a control on it may be corrupt.
    - production pc's are using Access Runtime or full version?
    - which one experiences failure? If only 1, perhaps Office/Access repair or re-install. If both pc's, likely not the problem but couldn't hurt.
    - I've reviewed your post and cannot tell if the fe actually opens. Additional code may help to pinpoint or prevent the error, such as testing for be connection assuming fe opens.
    - if error occurs when user clicks icon to open db, then it is the fe that cannot be found? That doesn't seem plausible based on your post though.
    - you do not have either file in any folder synced to One Drive I hope. Certainly, fe or be is not being Accessed from OD directly?
    - how do you edit design? If you modify last copy only and it is faulty, the fault remains. Did you ever open fresh db and import everything into it from prior version. If an object is corrupt, you'd bring that over so it likely would not solve anything. However, if the base db is corrupt, you should be able to get rid of that by starting fresh and importing objects.
    That's all I can think of for now.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Some more reading for you:
    https://stackoverflow.com/questions/...in-access-2007

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    153
    Quote Originally Posted by Gicu View Post
    Thanks to everyone who has responded, it has been a very useful read through all the suggestions.
    I tried the decompile, recompile, compress route several times - it seems that decompile doesn't like a linked database on a different drive ( my mdb is on a server mapped to the N: drive)
    So I unlinked and did the business before relinking.
    However it did not work.

    In truth this particular incarnation of the issue was not actually "File Not Found", everything worked on my development machine, but on a production machine the app simply disappeared with no error message of any sort shortly after starting.

    I tried many combinations - but the only thing which worked was to regress 2 versions.

    Browsing through the link above there are several references to the autostart module (start up form) and simply making a minor change (e.g. add a blank line to the code). In my case I deleted 2 blank lines.Saved everything and uploaded this version to production. All now works???

    So in this case decompile does not fix it but a minor change (and hence a recompile of the autostart form) seems to fix whatever issue was causing the problem

    Once again thanks to everyone - for those in the UK enjoy the Bank Holiday

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,563
    Well done. I would have never thought of deleting blank lines, as I like to use those for code clarity.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Sometimes Access apps develop 'phantom break points' e.g. if the app is closed whilst one or more break points are in place.
    When the code is run again, it may stop at the 'phantom break' or possibly throw a compile error such as File Not Found
    Making a minor code change or adding/deleting a blank line will indeed force a recompile and often avoid the issue
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  8. #8
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    AFAIK it is possible that even after compiling, the compiled version of the code can be different from what you're reading, and it can drive you nuts trying to find what's wrong. However, a decompile is supposed to fix that. I have edited code and then removed the changes just to force the ability to compile again, but I've never removed lines to fix a problem that went away without compiling again.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. File Not Found
    By TOPSie in forum Access
    Replies: 10
    Last Post: 01-20-2022, 02:22 AM
  2. File Not Found Error in Module
    By rcrobman in forum Modules
    Replies: 23
    Last Post: 03-07-2019, 07:21 PM
  3. Error : File not found
    By CoZak in forum Programming
    Replies: 5
    Last Post: 06-29-2018, 02:32 AM
  4. VBA File Not Found Message
    By dgutsche in forum Programming
    Replies: 2
    Last Post: 08-25-2014, 10:18 AM
  5. File Not Found error
    By polbit in forum Access
    Replies: 7
    Last Post: 07-10-2014, 09:54 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