Follow up... How do I force a muoltiselect to scroll to a selected record?

M

Max Moor

Hi All,

Mark woke me up to how to select a record in a multiselect listbox, but
if the record I select is way down the list, how do I make the list scroll
down so it's shown?

- Max
 
J

John W. Vinson

Hi All,

Mark woke me up to how to select a record in a multiselect listbox, but
if the record I select is way down the list, how do I make the list scroll
down so it's shown?

- Max

If you type its first letter... and if the entries are sorted alphabetically
as they should be... the listbox will jump to the first entry starting with
that letter.
 
M

Max Moor

If you type its first letter... and if the entries are sorted
alphabetically as they should be... the listbox will jump to the first
entry starting with that letter.


Hi John,

I'm sorry, I should have said, I need to make the box scroll to the
record from VB.

With a single select box, I use to search the list for the record I
wanted, then set the value to it, and the box would scroll to it. This
doesn't work for the multi-select type, because I can't use the bound
column that way.

- Max
 
J

John W. Vinson

I'm sorry, I should have said, I need to make the box scroll to the
record from VB.

With a single select box, I use to search the list for the record I
wanted, then set the value to it, and the box would scroll to it. This
doesn't work for the multi-select type, because I can't use the bound
column that way.

I'm confused. A multiselect listbox doesn't have "a selected record" - it has
zero, one, several, or all selected. Scrolling to "the selected record" is
ambiguous or meaningless!

Could you explain what you're trying to accomplish from the user's point of
view? What is this listbox being use for, if not to allow the user to freely
select from the choices it displays?
 
M

Max Moor

I'm confused. A multiselect listbox doesn't have "a selected record" -
it has zero, one, several, or all selected. Scrolling to "the selected
record" is ambiguous or meaningless!

Could you explain what you're trying to accomplish from the user's point
of view? What is this listbox being use for, if not to allow the user to
freely select from the choices it displays?

Hi John,

Sorry the reply was so long in coming. This listbox is actually in
multiselect mode all the time, as far as Access is concerned. I want it to
be dual duty however, and the multiselect property can't be changed in
code, so...

I keep a software switch of my own for mode switching. If in my
single select mode, when a click event occurs, I requery the main forms row
source to display the selected record's details.

There are occasions when the user will want to group records to
process them together, rather than just updating the one record's details.
In this mutiselect mode, I don't refresh the main form while selection of
records is being done, and switch right back to single mode as soon as the
selections are processed.

This all works fine, and, although sounds a little convoluted, makes
for a very smooth UI for this form.

There is also a need to search the records in the listbox recordset,
when in single mode, and move to the found record. Also, there are times in
single mode, when the user changes a piece of detail information on the
selected record that warrants the list being resorted or requeried.

Finding a desired record or going back to the active record after a
requery isn't hard. Once found, I can make a record be selected with the
selected property. If the active record doesn't just happen to be in the
top few rows of the listbox, it's not displayed, though. I want to be able
to make the listbox scroll to any single selected record.

Ah, but can it be done?

- Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top