Results 1 to 2 of 2

Thread: Keep References

  1. #1
    Join Date
    Nov 2011

    Unanswered: Keep References

    How can I make the db keep the module references when the db is copied to another pc?

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    1. You can enumerate the references of an Access project and some of their properties like this:
    Sub EnumReferences()
        Dim ref As Reference
        For Each ref In Application.References
            Debug.Print ref.Name, ref.FullPath, ref.GUID, ref.IsBroken
        Next ref
    End Sub
    2. If you know the name of the file that contains a reference or if you know the GUID of a reference, you can add it to an Access project like this:
    Sub AddReference(ByVal FileName As String)
        ' Add a Reference using the name of its file.
        Application.References.AddFromFile FileName
    End Sub
    Sub AddReference(ByVal GUID As String)
        ' Add a Reference using its GUID.
        Application.References.AddFromGuid GUID
    End Sub
    However, you must be aware that the library containing a reference must be registered on the target machine (using regsvr32.exe, see: Explanation of Regsvr32 usage and error messages). Copying the file is not enough.

    Also notice that if Access (full version or run-time) is installed on a machine you should not need any of these procedures.
    Have a nice day!

Posting Permissions

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