[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Determing if a check box is checked in a list box

Posted on 2002-04-12
2
Medium Priority
?
189 Views
Last Modified: 2010-05-02
Hi,
I  have a list box using the checkbox style.
Is there a way to determine if a certain item in the list is checked? If not, what good is the checkbox ?

I am using the ItemCheck event when I click on an item to check or uncheck it, but I don't see how to determine if the item is checked or not.

Thanks

Jeff
0
Comment
Question by:jscharpf
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 800 total points
ID: 6937684
use the Selected collection:

Option Explicit

Private Sub Command1_Click()
Dim intI As Integer

    For intI = 0 To List1.ListCount - 1
        If List1.Selected(intI) Then MsgBox List1.List(intI) & " is selected!"
    Next
End Sub

Private Sub Form_Load()
    With List1
        .AddItem "item 1"
        .AddItem "item 2"
        .AddItem "item 3"
        .AddItem "item 4"
        .AddItem "item 5"
    End With
End Sub
0
 

Author Comment

by:jscharpf
ID: 6937710
That's exactly what I needed!!
Thanks emoreau!!

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code 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…
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
Course of the Month18 days, 5 hours left to enroll

830 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