Access JumpStart 2.0 | Blog

A Rapid Development Framework for Microsoft Access

As I was working on some code to store custom tags related to controls, I thought it would be nice to use a dictionary object. Dictionary objects work by storing a value of some kind along with a key to find it.

The Scripting.Dictionary object uses the VBScript runtime reference which provides a nice dictionary object, but there is an issue with the fact that the VBScript system is being deprecated and we won’t necessarily be able to depend on the Scripting reference to exist by default in future versions of Windows. This means that apps that use that library reference could stop working properly and cause grief in trying to reinstall that reference on a new computer. This is a pain in the butt when you are working with customers and it is a grief I try to avoid.

So I was looking around for replacement dictionaries to see what was already out there. Turns out, there is a nice fast native VBA code implementation of it here:

https://github.com/cristianbuse/VBA-FastDictionary

This was built as a drop in replacement for the Scripting.Dictionary object, meaning if you load the class in your existing project, you could just change the Dim dict As Scripting.Dictionary references to Dim dict As Dictionary and that is all you’d have to do (theoretically).

In attempting to install the module for testing, I did find that I needed a particular reference that is normally enabled by default, the OLE Automation reference. Other than that, it appears to be compiling.

In addition, you can also load a basic suite of tests that use the Debug.Assert testing method. So if you want to make any changes to it, you can run the tests to see if your changes break any existing expected behaviors.

Pretty cool! Hats off to you Cristian Buse!