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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After save, move to next row in listbox. 1

Status
Not open for further replies.

ponderdj

MIS
Dec 10, 2004
135
US
Hello,

I have a fairly simple question, I think. I have a listbox that sets the recordsource of the form when the user clicks on a row. When the user saves certain changes, the record on the row they selected no longer meets the criteria for the listbox and when the listbox requries after the save, the row is dropped. How can I make the focus drop to the next line in the listbox?

Thanks
 
Save the ListIndex property of the listbox before the requery:
With Me![listbox name]
intOldIndex = .ListIndex
.ReQuery
.SetFocus
.ListIndex = intOldIndex
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Ahh, ListIndex. That's what I was looking for. Thanks PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top