Solved

simple listview question

Posted on 1998-11-26
1
132 Views
Last Modified: 2010-05-03
how do i add something to the 2nd or 3rd row over in a list view?
example:

Title 1 | Title 2 | Title 3
--------+---------+--------
item1   |subitem1 |subitem2
item2   |subitem3 |subitem4
and so on...

my question is how would i add the sub items.
I can construct the columnheaders, but i cant get the subitems.

if possible, please include any code or examples.
Thanks alot.
0
Comment
Question by:whasup55
1 Comment
 

Accepted Solution

by:
Belgarion_aus earned 190 total points
ID: 1447055
Here is a code example...

Private sub AddToList(strItem as string,strSubOne as  
    string,strSubTwo as string)

   Dim objItem as Listitem

   Set objItem = listview1.ListItems.Add(,,strItem)
   objItem.SubItems(1) - strSubOne
   objItem.SubItems(2) - strSubTwo

   set objItem = nothing

End sub
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now