I do my development in Access 2016. I've created a custom shortcut menu (right-click menu) with VBA. In order for this VBA code to run, I have to enable the Microsoft Office 16.0 Object Library reference.
Whenever I deploy this database to PCs with older versions of Access (2013 and 2010) the database is looking for the Microsoft Office 16.0 Object Library, which does not exist. I hoped that Access would be smart enough to automatically select the appropriate Object Library for the version of Microsoft that is installed. However, it does not and the code will not run until I manually set the appropriate object library.
Is there a better way to automate this? Is there some VBA code I can implement that will find the correct library? The only solution I've come up with is setting the Object Library in an older version of Access before deploying the database to other PCs(there doesn't seem to be a problem finding newer Object libraries, only older ones.)
Thanks guys.
application.VBE.ActiveVBProject.References.AddFromFile("")
you could use based on the version? – Nathan_Sav