none
References RRS feed

  • Question

  • Hi all,

    I have an issue that is very frustrating.

    I have an Access file with modules for commonly used code used in the original or main Access program. I am referencing this file in the Reference of the VBA. The reference location is also on the server.

    I am doing my development and maintenance on my local hard drive. I then copy the program to the server.

    When users click on a .cmd file stored on their local disk, this .cmd file copies the front end program from the server onto their local disk. It then opens the local copy of the program for processing.

    Every time that I make changes to the front end program, and the users run the .cmd and copies the program to their local disk, Access opens the front end and displays a message that the reference is missing. It seems as if the reference location is changed from the server to the local disk each time the program is copied onto the local disk.

    If this is the case, can this change of the location be prevented?

    I trust I am explaining myself sufficiently.

    Thanks

    Deon

    Thursday, July 11, 2019 1:33 PM

Answers

  • He is talking about updating what we call a library reference. 

    See this post:

    https://www.devhut.net/2017/11/14/ms-access-library-databases/

    So, if you have 15 access applications you built, then you can have ONE shared code library of code that you ONLY have to maintain. You update that ONE  code base, and all of your existing access applications now get to use that new code - and do so without having to import, or update or do anything. 

    Think of windows and a .dll (dynamic linked library). By simply updating ONE .dll on that computer, then 100's if not 1000's of programs now are updated (because they all used that common .dll).

    This type of shared library development approach means that a simple update of your code is now instantly used by all your other programs. 

    I can grasp some not realizing this feature exists in Access (like it does for most development platforms), but not grasping WHY someone would not think this is fantastic has little to do with Access development, but a general common sense approach to all things in life.

    The poster is NOT really talking about updating the Front end, but keeping the reference to the common shared code library system that access supports.

    Now, to be fair, the poster is finding that EVEN when you used a automated installer, or even a commercial automatic front end updater, they are finding that the references to the common custom code library created with access is being lost.

    Read the above link, and then some of the STUNNED posted comments about how people did not know this feature exists in Access.

    Anyway, I believe that placing the front end and the shared library code module in the same folder on the target computer WILL work. note that is the case for a code library reference, but NOT for an add-in.

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada


    • Marked as answer by Deon SA Tuesday, July 16, 2019 9:14 AM
    Friday, July 12, 2019 8:23 PM

All replies

  • It sounds like each user needs to update their references on their own Front-end copy each time you have an update. The reference is obviously not being carried forward with each update. Why don't you simply import the VBA code modules into the front-end file? You wouldn't need any reference to it.
    Friday, July 12, 2019 1:12 PM
  • I use the same way of update the front-end from my users.

    I have a version control in my application to "call" the cmd comparing the value I set in the Project description property from the front-end with a value in a table of the back-end.

    In the cmd I use the command XCOPY with /y parameter to overwrite the accdb file front-end

    I suggest you make a dummy change in the front-end code using a user workstation and then publish it on the server and see if in the other users the issue persist. 

    I also use a compact and repair /decompile before publish the front-end.


    Joao Simplicio Rodrigues

    Friday, July 12, 2019 6:19 PM
  • He is talking about updating what we call a library reference. 

    See this post:

    https://www.devhut.net/2017/11/14/ms-access-library-databases/

    So, if you have 15 access applications you built, then you can have ONE shared code library of code that you ONLY have to maintain. You update that ONE  code base, and all of your existing access applications now get to use that new code - and do so without having to import, or update or do anything. 

    Think of windows and a .dll (dynamic linked library). By simply updating ONE .dll on that computer, then 100's if not 1000's of programs now are updated (because they all used that common .dll).

    This type of shared library development approach means that a simple update of your code is now instantly used by all your other programs. 

    I can grasp some not realizing this feature exists in Access (like it does for most development platforms), but not grasping WHY someone would not think this is fantastic has little to do with Access development, but a general common sense approach to all things in life.

    The poster is NOT really talking about updating the Front end, but keeping the reference to the common shared code library system that access supports.

    Now, to be fair, the poster is finding that EVEN when you used a automated installer, or even a commercial automatic front end updater, they are finding that the references to the common custom code library created with access is being lost.

    Read the above link, and then some of the STUNNED posted comments about how people did not know this feature exists in Access.

    Anyway, I believe that placing the front end and the shared library code module in the same folder on the target computer WILL work. note that is the case for a code library reference, but NOT for an add-in.

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada


    • Marked as answer by Deon SA Tuesday, July 16, 2019 9:14 AM
    Friday, July 12, 2019 8:23 PM
  • Every time that I make changes to the front end program, and the users run the .cmd and copies the program to their local disk, Access opens the front end and displays a message that the reference is missing. It seems as if the reference location is changed from the server to the local disk each time the program is copied onto the local disk.

    Hi Deon,

    You could try to add the reference during start-up of the application using:

    Access.References.AddFromFile <full filespecification>

    Imb.

    Imb.

    Friday, July 12, 2019 9:32 PM
  • just a little bit to add: If the reference is to an application - for instance Adobe - and not all PCs have that application loaded, then this would have a very similar symptom as described.

    in my case while everyone had Adobe Reader - not everyone had the full Adobe license which was needed for some features added to the Access application.... 

    Friday, July 12, 2019 10:47 PM
  • Albert,

    Thank you.


    Joao Simplicio Rodrigues

    Saturday, July 13, 2019 3:37 PM
  • Hi Albert,

    What you are describing is exactly the issue.

    I used Imb's suggestion, and it works fine. I am checking the reference path and file name at start up. If it does not compare, I delete the reference and add it again with the correct path and file name.

    Thanks a mil for your input and suggestions to resolve my issue.

    Regards

    Deon

    Tuesday, July 16, 2019 9:13 AM