Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing Selected Record in a ListBox

Status
Not open for further replies.

dftjsn

Programmer
Feb 25, 2002
43
US
I have an unbound listbox on a popup-dialog form that is populated with several hundred entries from a union query. The user can only select one record (Multiselect=None). Upon opening the form, I want to highlight (select) the user's previous entry at this screen with:

lstboxSelectACitation.Selected(RecNuminLstBox) = True

This works as long as the record is one of the first 20 or so that can be displayed in the listbox as sized. If the selected record is off-screen, I'd like the listbox to adjust to display it - for example, display the selected record in the middle of the listbox with an equal number of records above and below. As it works now, the only adjustment is that the listbox shows the 20 records above the selected one. The selected record is the first one just below the listbox (that is, if you scroll the listbox up one, you'd see the selected record at the bottom of the listbox).

Does anyone know how to make the selected record display in the middle of the listbox or at least somewhere in the listbox so the user can see it without scrolling?

Thanks!

dftjsn
 
stboxSelectACitation = stboxSelectACitation.Selected(RecNuminLstBox)

Guess it will show it (haven't tried though)

HTH
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top