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
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
  • 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)


Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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

765 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