Results 1 to 3 of 3

Thread: Error 91: object variable or with block varaible not set

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    5

    Error 91: object variable or with block varaible not set

    "Error 91: object variable or with block varaible not set"

    i am getting the above error while retrieving the index of selected row in listview

    please help me out

    Private Sub ListPersons_DblClick()

    Dim row As Integer
    Dim item As ListItem
    Dim personid As Double
    Dim bsuccess As Boolean
    Dim msName As String


    'Listpersons is the name of listview
    row = ListPersons.SelectedItem.index
    personid = ListPersons.ListItems(row)

    End Sub

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Error 91: object variable or with block varaible not set

    ListPersons.SelectedItem.index will give you that error if there is no item selected or listview does not have any item.

    ListPersons.ListItems(row) will return a listitem, that cannot be assigned to a number.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    5

    Re: Error 91: object variable or with block varaible not set

    the listview is not empty and i have selected an item too
    i dont think tht's the problem
    thank u

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