ADH MultiPik SetCollections method not working in A2002

P

Piet Linden

Maybe it's just me, but I can't get the SetCollections method to
work... I populate the collection with a list of queries, which works
fine. To test it, I get a count of items in the collection and it
returns the count as it should. When I call the SetCollections
method and pass in the two collections, neither listbox gets
populated.

e.g.

Public Sub SetCollections(Optional colAvailable As Collection,
Optional colSelected As Collection)
Call FillMultiPikCollection(colAvailable, colSelected)
End Sub

in my code, here's the line that should do the setting...

Dim colAvailable As Collection, colSelected As Collection
Set colAvailable = colChosenQueries("Available")
Debug.Print "colAvailable: " & colAvailable.Count
Set colSelected = colChosenQueries("Selected")
Debug.Print "colSelected: " & colSelected.Count

Dim arrSelected() As Variant
Dim arrAvailable() As Variant

Set mmp = New MultiPik

.....

then it does the standard SetArrays and assigns them... I didn't
modify any of that.

But alas, I never get any data in my listboxes. What gives?
 
S

Stefan Hoffmann

hi Piet,

sorry, but what the heck is "ADH MultiPik" ?


mfG
--> stefan <--
 
P

Piet Linden

hi Piet,

sorry, but what the heck is "ADH MultiPik" ?

mfG
--> stefan <--

Sorry Stefan... (and everyone else!) There's a class module included
in the code in Access Developer's Handbook, Desktop Edition.... (Hence
ADH...)

Since Ken Getz & Co. wrote the code, I would assume that it works - I
can get the other methods of the class to work (the simpler ones,
like .SetData), but this one just won't populate my listboxes!) I
guess I could resort to one of the simpler methods, but the problem is
that I am manipulating Querydefs, and only some of the Select and
Crosstab queries. I can indentify them all just fine, stuff them into
a collection just fine, pass those collection objects to the other
methods without error, but I can never populate the listboxes.

If I call SetData and specify a table and a column, they populate, but
that's too simple. My rules are a bit more complicated than the ones
SetData is built for.

Any thoughts?

If you need a copy of the DB, I can e-mail you one...

Pieter
 
P

Piet Linden

I fixed it... (it won't be breeding anymore!)

turns out it was a pretty stupid error....

'part 1... (in the form_load event)

' Or two collections, using the SetCollections method.
Set colSelected = RR_Queries(True)
Set colAvailable = RR_Queries(False)
mmp.SetCollections colAvailable, colSelected

Set colSelected = Nothing
Set colAvailable = Nothing

and then I wasn't using SET to return an object... figures my code
would not work!

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top