Unable to check/uncheck listview checkbox

Posted on 2004-11-09
Last Modified: 2013-12-25

I have a listview control with checkboxes. I am able to select any item by clicking on the text and the checkbox is checked/unchecked. However, when I attempt to select the item by clicking on the checkbox, I am unable to check/uncheck the text box.

Your help is appreciated.


Question by:welcomes
    LVL 48

    Expert Comment

    by:Ryan Chong
    Did you write scripts inside the ListView's ItemCheck Event ? Try check the script logic behind as you may check the checkbox while it's unchecked.

    Post your scripts here if necessary, regards

    Author Comment

    Thanks. I believe I finally got it working. FYI, here is the ItemCheck code...

    Private Sub lstvwSector_ItemCheck(ByVal Item As MSComctlLib.ListItem)
        Dim i As Integer
        i = Item.index
        If lstvwSector.ListItems.Item(i).Checked = True Then
            lstvwSector.ListItems.Item(i).Checked = False
            lstvwSector.ListItems.Item(i).Checked = True
        End If
        lstvwSector.ListItems.Item(i).Selected = True
    End Sub
    LVL 48

    Accepted Solution

    Glad you resolved your problem, since then i got 2 suggestions:

    1. Post a request at Community Support to have a refund , or
    2. Accept my comment as the Answer, ONLY if you think i did make some help here

    cheers ;-)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    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…
    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…
    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…

    729 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

    18 Experts available now in Live!

    Get 1:1 Help Now