Solved

ListBox Select Item without Index

Posted on 2008-06-19
1
2,093 Views
Last Modified: 2008-06-19
Hi,

How can I multiple select items in a ListBox without knowing the Index?

Any workaround?

I'm using MS Access 2002.
' Can I do something like this:
List134.Selected("item 1") = True
List134.Selected("item 2") = True
 
' Instead of this:
List134.Selected(0) = True
List134.Selected(1) = True

Open in new window

0
Comment
Question by:cukcuk
[X]
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
1 Comment
 
LVL 7

Accepted Solution

by:
Chrisedebo earned 50 total points
ID: 21820454
use a for next loop to loop through the items in the list and set selected to true if you find the value you are looking for.
Dim i as integer
 
For i = 0 To List134.ListCount - 1
    If List134.ItemData(i) = "item 1" Or List134.ItemData(i) = "item 2" Then List134.Selected(i) = True
Next

Open in new window

0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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