I've set up a listview in my project, and a command button which opens a seperate form with a "find" box on it.

When the user clicks the "find now" button on the second form, I do a FINDFIRST on the recordset of the listview control, and now I want to close this window and highlight the "found" record on the listview.

I tried setting the key of each list subitem when I was adding them by

sCurJob = Format(CStr(myRs!jobid), "000000")
Set itmX = ListView1.ListItems.Add(n, sCurJob, sCurJob)

and then just use

Set frmAllList.ListView1.SelectedItem = _
frmAllList.ListView1.ListItems(sNum)

where sNum is the "jobid" field of the found record, but I keep getting "Invalid Key" on the Add method.

Scrapping this (temporarily), I tried the .FindItem method, but this only seems to work satisfactorily for the main item, and not the subitems, even though I set the 'value setting' to 1 (for lvwSubitem).

Has anybody any experience of this kind of thing, and how did they handle it? (Better than these clumsy tries, I bet!)

Ta.