Adding References from VBA
Did you ever wish you could bypass the Tools > References dialog entirely when adding references in Access? Automate the process with some simple VBA.
To use early binding, you must add References to your VBA project.
Go to Tools > References... to do this manually from the VBA editor.
But what if you want to add those references programmatically, via VBA? To do this, you can use the AddFromGUID method of the Access Application References collection.
'Add a reference to the Microsoft Scripting Runtime
References.AddFromGUID "{420B2830-E718-11CF-893D-00A0C9054228}", 1, 0
Finding GUIDs for References
That's great and all...but how are you supposed to find the GUIDs in the first place?
The simplest approach is to manually add the reference to your project, then cycle through all the project references and print the required information to the Immediate Window. In fact, you can use the following one-liner to print the required info directly from the Immediate Window:
For Each ref In References:?ref.Name, ref.GUID, ref.Major, ref.Minor:Next