Hi all


I use the code below to search for an employee data , by using the employee number.

In the form I have only one listview1 and one text box for search use.
someone Suggested to change Set lvAccounts.SelectedItem = x.selected

to this 'Set lvAccounts.SelectedItem = x but does not work .


When I use this code I always get this message
Invalid property value , err 380

Any one can help please ?
Thank you in advance

Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim x As ListItem
Set x = ListView1.FindItem("emp_number", lvAccounts, elvSearchText)
If (x Is Nothing) = False Then
Set lvAccounts.SelectedItem = x.Selected
End IfEnd