title: Double Click list box to Open Form to Specific record
body: <p>I have a list box that displays my entire Access databases records with a brief descriptions in additional columns.  The first column (0) has the record identifier (PART NUMBER) which is the primary key in the table.  I am trying to get the double click event to open the "SETUP SHEET DATA ENTRY" Form to the specific row in the list box.  The part number is classified as text and not numerical.  I don't know what the problem is and any advice would help.</p>
  
  <p>List box name = Listallpart</p>
  
  <p>Primary key in table name = PART NUMBER</p>
  
  <p>Table name = Setup Sheet History</p>
  
  <p>Form name = Setup Sheet Data Entry</p>
  
  <pre><code>Private Sub Listallpart_DblClick(Cancel As Integer)
      DoCmd.OpenForm "SETUP SHEET DATA ENTRY", , , "[PART NUMBER] = " &amp; Me.Listallpart.Column(0).Value
  End Sub
  </code></pre>
  
  <p>I have another question very similar....</p>
  
  <pre><code>Private Sub Listallpart_DblClick(Cancel As Integer)
  Dim strpn As String
  Dim strco As String
  
  strpn = Me.Listallpart.Column(0)
  strco = Me.Listallpart.Column(1)
  
  DoCmd.OpenForm "SETUP SHEET DATA ENTRY", , , ("[PART NUMBER] = '" &amp; Me.Listallpart.Column(0) &amp; "'" And "[CURRENTOPERATION] ='" &amp; Me.Listallpart.Column(1) &amp; "'")
  
  End Sub
  </code></pre>
  
  <p>The code above is for another mod to the code.  Every record has these 2 required unique fields.  I am getting a "run time error "13" mismatch type".  I added the two variables in the beginning to make sure the values are correct.  I inserted break points and confirmed the values.  The data is numerical.</p>