Solved

simple listview question

Posted on 1998-11-26
1
134 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

861 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