Dealing with Collections and Arraylists in VBA/Access

I am trying to take a form, create a query from entries on the form, create an Arraylist from the query results and then compare that Arraylist to a Collection of objects to see if a member of the collection (with an attribute of same type as Arraylist) is on the Arraylist.  Is it possible to do this in Access?
Michael SullivanAsked:
Who is Participating?
 
Bill PrewCommented:
In addition to the native objects in VBA, you can use ArrayLists and Dictionaries form additional references.  In a late binding approach, things like this work and allow usages of these useful objects.

    Dim alist As Object
    Dim dict As Object
    Dim col As Collection
    
    Set alist = CreateObject("System.Collections.ArrayList")
    Set dict = CreateObject("Scripting.Dictionary")
    Dim col As Collection

Open in new window


»bp
0
 
Bill PrewCommented:
Without too many details, I'd say that is all doable.  Dictionary objects may be useful for the cross checking 'lists'.  As long as the number of items in a list isn't massive it sounds doable.  It's a fairly large solution, you may want to break this into smaller questions once you get some draft code and data details to share.


»bp
0
 
Michael SullivanAuthor Commented:
I started and have done a little bit  of the code.  I actually already wrote the whole thing in Java (using sqlite and SWT in Eclipse for the forms).  The data objects in VBA just seem "limited", but I have done a bit already.  I do appreciate the answer, as I didn't want to spend a whole bunch of time on this only to find that it ultimately isn't possible.  I will definitely be back with questions (and maybe some code) as I go.  Thanks VERY much for the advice.
0
 
Michael SullivanAuthor Commented:
Thanks for the advice.  I will be back if I run into issues.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.