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

find in listview 1

Status
Not open for further replies.
Set ITMX = .FindItem(myvar, lvwSubItem, 1, lvwPartial)
 
And in what way is the native FindItem method of the control letting you down? Presumably because it isn't finding anything - and that's because you can't do partial matches against subitems; this is covered in the VB6 documentation. However, given you have previously indicated that for some reason you don't have VB6 help available on your system, here is a link to the online version (better than nothing, I'd suggest): [URL unfurl="true"]https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa232759(v=vs.60)[/url]. You also seem to have odfd expectations concerning myvar, using it both as the source of the string tou want to compare against, and at the same time wanting it to return with the row number)

But let's be clear here; are you really wanting to search the subitems? The first column in a listview (unless you have done something very specific to suppress it) is the listitem, not a subitem, and you CAN do partial matches against those.

So ... have you tried:

[tt]Set ITMX = .FindItem(myvar, lvwText, 1, lvwPartial)
rowfound = ITMX.Index[/tt]
 
Tks for code, work!

note:
Th MS link is broken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top