Results 1 to 2 of 2

Thread: Help need please

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    137

    Question Help need please

    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

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    I don't do this kind of stuff, so this is a guess.

    In

    lvAccounts.SelectedItem = x.Selected

    it appears to me that x.selected, if such a property exists at all, is likely to be a boolean indicating whether or not x is selected.

    lvAccounts.SelectedItem

    on the other hand, would seem likely to be an integer that is the index of the selected item.

    equating these two would be a mismatch of types and that could give the error you're seeing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width