Brain cramp! setting value of multiselect list

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I've got a listbox that I'm using for several purposes, based on several of
the other controls on a form. I had thought about using multiple lists (some
multi-select, others single-select), but after working through the number of
combinations of functionality, decided it would take about 6 different lists,
and decided to try using one list instead.

Depending on the selections in a couple of combo boxes, I wanted to display
different fields (just change the column widths - this works fine).

In other instances, I need to switch between multi-select and single-select
(obviously this is a problem). I've worked out a way to ensure that only a
single item is selected when I want the single select functionality.
However, in one instance I have to requery the list, and after the requery, I
want to highlight the single row that was highlighted prior to the requery.
Since I cannot set the listindex, I'm using:

intListIndex = lst.listindex
lst.requery
lst.Selected(intListIndex) = true
debug.print lst.listindex

which works to highlight the previously highlighted row. However, after the
requery and the next line of code, the lists listindex property shows -1.
Is there any way to get the lists listindex property to reflect the previous
value?

I'm about ready to go back to the drawing board and resort to multiple
lists, but thought I'd check with you guyst first.

Thanks.
--
Dale

email address is invalid
Please reply to newsgroup only.

.



Relevant Pages

  • Re: The Bushkultie Hates America
    ... While lists kindly situate spines, the contexts often highlight ...
    (comp.os.linux.misc)
  • Re: Brain cramp! setting value of multiselect list
    ... I had thought about using multiple lists (some ... Depending on the selections in a couple of combo boxes, I wanted to display ... However, in one instance I have to requery the list, and after the requery, I ... want to highlight the single row that was highlighted prior to the requery. ...
    (microsoft.public.access.formscoding)
  • RE: sorting code
    ... This highlighted cells A1 to A5. ... if I simply add data to column A in "Lists" the correct cells are ... Private Sub Worksheet_Change ... highlight the code and click the "Comment Block" icon on the ...
    (microsoft.public.excel.misc)
  • Re: WMP11 Beta - loss of functionality
    ... In the Songs Library, you used to be able to highlight a title, and switch ... the new sort order, and you have to go looking for the highlighted item. ... This wastes time. ... behavior of the lists. ...
    (microsoft.public.windowsmedia.player)
  • Re: OT ...Way OT ...email etiquette
    ... just received an email from my uncle about an email I sent my ... I have removed her from lists of quilting forwards I have ... but in the message I highlight all the previous ... forward which will allow copying. ...
    (rec.crafts.textiles.quilting)