I am pretty unsure that the variable is correct. I really don't know where or how to look at.
This line
PHP Code:
$condition .= 'field7 LIKE("' . $db->escape_string_like($ltr) . '%")';
should look in the profilefield id 7 (that is where I store users lastname).
But the query (whereever it is build) doesn't search in there. Hope for someone who is more comfortable with the code in vB.