[Webinar] Streamline your web hosting managementRegister Today


ListView Control Documentation

Posted on 2003-02-23
Medium Priority
Last Modified: 2013-12-25
Hello All,

  I have several questions but I am trying to find some solid documentation on VisualBasic(MS Access 2000) - specifically on the ListView & ListItems. I can't seem to find any good documentation and I think I have exhausted google. Anyway, I will ask the questions but I believe that they could all be answered if someone could give or point me to adequate documentation on the ListView & ListItem controls and since it is a seperate control there is no documentation in the help files.

1. How do you make the ListView row uneditable?
   - Currently I have the fullrowselect set to true and it drops into edit mode on the first item in the row.
2. It doesn't seem to have an event for a doubleclick. Is there a way to change that?
3. Once an event is activated (i.e. listview1_enter()), how do you retrieve the values of the selected item?
4. Is there a way to make a column in the list view hidden(i.e. a key field - I want to show the data but not the key)?

I think that's all for now. Sorry for all the questions, I would be appreciative of any help. Thanks in advance.

Question by:renrutm
  • 4
  • 2
LVL 27

Accepted Solution

Dabas earned 225 total points
ID: 8007366
1) Set the LabelEdit property to Manual
2) My listview has a DblClick Event.
Have a look at your Components screen. Are you using Microsoft Windows Common Controls 5.0 or 6.0?
I am using 6.0 SP4
3) I wonder if we are talking about the same ListView, as mine do not have an _enter() event.
Anyhow, the value of the selected item can be retrieved via: Listview1.SelectedItem.Text
4) Yes. Change its Width to a value smaller than 10.

Hope this helps, otherwise ask again!


Author Comment

ID: 8014259

   Thank you for a little of your expertise. I am using 6.0 SP4 just like you. Do you know where I can get documentation on the controls and their methods and properties? These are just a few of the problems I am running into. I have looked on the web and am only finding a little of the info I need.
1. Worked - Thanks.
2. I made a DblClick() Method and it worked.
3. Worked. Not that I need it to now, but how do you get to the other subitems of the list item? Right, now it only returns the first subitem(which happens to be the key). Thanks.
4. Works. Thanks.

3 and 4 I almost thought didn't work because I don't have documentation, so I didn't know how to do what you were saying, but I eventually figured it out. Thanks for all your help. If I can get more points I will ask more questions. Thanks again. This helps me out tremendously. If you know where to find good documentation, that would help out a lot too.

LVL 27

Expert Comment

ID: 8014313
3. You are wrong. The first subitem is actually the second column. The first column is the ListView1.Text property.

This is how the other columns are set (providing the view is set to Report)

Dim li as ListItem

Set li = ListView1.ListItems.Add(,,"Text for first Column")
li.Subitems(1) = "Text for second column"
li.Subitems(2) = "Text for third column"


So to read the values back, assuming you want to do so for the selected item, I would program it like this:

Set li = ListView1.SelectedItem

If Not li is Nothing Then'check that actually something is selected, otherwise you get a run time error
MsgBox "First Column = " & li.Text
MsgBox "Second Column = " & li.Subitems(1)


The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

LVL 27

Expert Comment

ID: 8014317
As to documentation, have you tried highlighting a ListView and pressing F1 for help?

If you do get help for the ListView, then click on "See Also" and select "Using the ListView Control"

It has lots of examples and explanations


Author Comment

ID: 8018366
Thanks Dabas,

  I am using MS Access and It doesn't have any documentation(or I haven't found it) on any of the controls except those which are packaged with (i.e. Textbox, label...). I have already tried what you said(higlighting and pressing F1) and it comes back blank - no see also or anything. I wish I had the help files, if so, I wouldn't have run into these problems and I wouldn't have to bug you. I will try what you said with the subitems. Thanks again for you time and effort.

LVL 27

Expert Comment

ID: 8019265
Aaahhh... Now I understand!!!
Programming in Access is torture and I do not envy you!


Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

612 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