title: VBA ListView control - retrieve columns from selected item
body: <p>I have a ListView object within my Microsoft Access database that is set to <strong>Report View</strong>.  When a user selects a row from this list, I want to be able to open a secondary form and populate based on the selected values.  I am running into trouble with the proper syntax for capturing the column values I need.  I have searched high and low looking for information on this, however I have not been able to find anything that fits my particular criteria.</p>
  
  <p>Here is the code in question:</p>
  
  <pre><code>Private Sub ListView1_ItemClick(ByVal Item As Object)
  
    Dim FormID, FilingID, RowIndex As Integer
    Dim FilingName As String
  
    RowIndex = Item.Index
  
    FormID = Item.SubItems(0)
    FilingID = Item.SubItems(1)
    FilingName = Item.SubItems(2)
  
    If MsgBox("Do you want to open up filing " &amp; FilingName &amp; "?", vbYesNo, "Confirmation") = vbYes Then
       DoCmd.OpenForm "frmFiling", acNormal, , , , , "FormID=" &amp; FormID &amp; ";FilingID=" &amp; FilingID
    End If
  
  End Sub
  </code></pre>
  
  <p>This code keeps throwing an exception on the line FormID = Item.SubItems(0) stating that it is an invalid property value.</p>
  
  <p>Does anybody know what I am doing wrong here, or have a workaround that accomplishes what I am trying to do?</p>