title: Open a Form with ID MS Access
body: <p>I've read a few of the threads that address this issue, but I'm still having an error where the form opens to a blank record. </p>
  
  <p>My setup is that I have a "Contact File" form that displays general contact information on an individual from a "Master Contact Database" table. At the bottom of this form, I have a subform that displays case information for that individual and also allows the user to create new cases. This information is properly storing in the "Casefile Information" table I've created in Access. </p>
  
  <p>However, when I try to open the "Casefile Information" form, with a button and a text field on the "Contact File" form, it brings up a blank record. I've tried using MS Access' built in "button" creation tool to create a macro as well as the following VBA:</p>
  
  <pre><code>Private Sub Command112_Click()
  DoCmd.OpenForm "Casefile Information", , , "CASEID = " &amp; Me.Text98
  End Sub
  </code></pre>
  
  <p>I've also tried this method: </p>
  
  <pre><code>Private Sub Command112_Click()
  Dim RecordID As Integer
  RecordID = Me.Text98
  DoCmd.OpenForm "Casefile Information", , , "CASEID = " &amp; RecordID
  End Sub
  </code></pre>
  
  <ul>
  <li>Text98 is the text box on the "Contact File" form. </li>
  <li>The CASEID Is 8 numeric characters, the primary key for that table, user entered but with no duplicates allowed. </li>
  <li>The second example above returns an error (6) on the RecordID=Me.Text98 line. </li>
  </ul>
  
  <p>For whatever reason, there is ONE record in the database that this works properly but no other contacts and no other case files for that contact will load correctly.</p>
  
  <p>Thanks! </p>