Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


View a collection item

Posted on 1999-07-28
Medium Priority
Last Modified: 2010-04-30
I have collection object created and i am trying to add an class object to the collection object.
Now after i add the class object i want to view the item added to the collection , how can i do that ?
any comments ..........
I tried print mcol.item(1) or
        mcol.item(1).show   -  but it won't  work
  where  mcol is the collection object.

Thank You
Question by:Kasach
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 1528005
Edited text of question.

Accepted Solution

strongd earned 30 total points
ID: 1528006
Here's the way I view item in a collection.  

myitem = mcol.item(1)

when you step through this with the debugger you'll see that myitem will variable will now be item 1 in your collection.  It is just an easy way to see what is in the collection.   If you have more than 1 thing in your collection then use a For-Next loop.
For i = 1 to mcol.count step 1
     myitem = mcol.item(i)
next i

Set your break point at the For i ....etc...   then just step through.   This seems to be the easiest way to see what the order is in the collection.   Also make sure that myitem is defined as what ever is in the collection.   So if you defined or dim the collection as a string, make sure that myitem is dim as string.   Hope this helps.  


Author Comment

ID: 1528007
Thanks Strongd, but my intention was something else..

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question