Selecting a single value from a listbox with multiple items selected

BigJimSlade

Registered User.
Local time
Today, 18:26
Joined
Oct 11, 2000
Messages
173
Hi, Big Jim here....

Say I have a listbox with Items A,B,C,D and E.

C,D and E are all highlighted.

I would like someone to be able to double click C and have my code retrieve the value of C. How can I do this with the others (D and E) selected? Looping through the ItemSelected will not necessarily provide me with the right value.


Thanks in advance!

Big Jim
 
Hi Big Jim,

I couldn't resist researching this. This initially seemed to
be the right thing to do with the On-Double-Click event.

If Me.List252.Selected(Me.List252.ListIndex) = True Then
MsgBox ("Chose # " & Me.List252.ListIndex)
End If

But, there's no need for the test, because when you
double-click it, it gets selected anyway.

The only suggestion that I can figure out is to maintain an
array using the OnClick event and record the time the
list item was selected.

Then on the double-click event, do nothing if it was set within
the last few tenths of a second. Now see what you've done
to me. Of course it will have been set!

If it has already been selected then don't update the time.

What is this for anyway?

I'll be interested in seeing what becomes of this.

Wayne
 
Wayne Ryan!

Your idea was very ingenious I think. To answer your question, I create (on the side) some in-house applications for my business unit to expedite using Access.

One of these applications allows the user to enter a string into a text box. That string is than compared to the SQL of all the queries, and if a query contains the string, the query name is highlighted in a listbox of all queries. The option is then there to do a find/replace on all of the highlighted queries.

From this listbox, it would help if someone could click on one of the many highlighted queries and have it open the SQL.

Those were my thoughts!

Thanks for your response, Wayne Ryan!

Big Jim
 
Wayne! Thanks! Very cool website! Everyone should check it out, as they have some cool stuff.


Thanks again!

Big Jim
 

Users who are viewing this thread

Back
Top Bottom