• references, different versions of Library (Access03)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » references, different versions of Library (Access03)

    Author
    Topic
    #430093

    I have a large database that I have been building over the last couple of years with a lot of support from you guys. The other week I added a reference to Microsoft Word 11 Library. Everything worked okay on my system, but the secretary is using Version 10. She started getting a message something like date function not declared. I looked in her reference section and it states that Library 11 is missing. I manually set the reference to Library 10 and everything works okay until after she logs out and relogs into her computer she get the message again. How do I deal with this? Thank you. Fay

    Viewing 0 reply threads
    Author
    Replies
    • #1003282

      Hello Fay,

      Missing references are one of the banes of developers.

      The general rule is: if you set a reference to one of the Office applications, the reference will automatically update itself if you open the database in a newer version. For example, if you work in Access 2000 (version 9.0), and set a reference to the Microsoft Excel 9.0 Object Library, then open the database in Access 2002 (version 10.0) or Access 2003 (version 11.0), the reference will automatically point to the 10.0 or 11.0 version of the object library.

      However, this does not work if you move from a later version to an earlier version: you developed the database in Access 2003, and if you open it in Access 2000 or 2002, you’ll get an error message.

      One solution is to open the database in the earliest version of Access that you need to support, set all references correctly, then distribute this copy of the database.

      Another option is to use late binding.This means:

      – Replace all declarations of the type Dim w As Word.Application or Dim w As Word.Document etc. with Dim w As Object.
      – Use CreateObject to create the Word.Application object instead of the New keyword: Set w = CreateObject(“Word.Application”)
      – Replace all Word VBA constants such as wdSaveChanges with their numeric value – you can look up these values in the Object Browser.
      – Finally, remove the reference to the Word object library.

      If you use late binding, the code should run on all PCs with a version of Word, unless you used features that are specific to Word 2003.

      • #1003290

        Thank you Hans for your response. It is good to know I didn’t screw up. I was getting ready to work with printing specific reports from the database.

        Okay I will remove the reference from the database in my computer and reapply it for the older computer and see if that works. Thank you. Fay

    Viewing 0 reply threads
    Reply To: references, different versions of Library (Access03)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: