title: How do I change the record my data entry form is entering to
body: <p>Hi I am very new to vba and microsoft access. I have a data entry form with 3 comboboxes and a date box that save to the Shift, Operator, Date_Field and Machine fields of the Tracking table. These four fields are a unique index. I want the form to operate so that the person filling it out can be automatically navigated to the record that already exist if they fill in a Shift/Operator/Date/Machine combo that already exists. Right now I am testing this code in the afterupdate section of the MachineCbo combo box. I can find out if a record matching those criteria already exists, but I cannot figure out how to make it so the form is adding more data to that record.</p>
  <pre><code>Dim int_ID As Integer
  With Me
  'checks if duplicate record exists and stores it as int_ID variable
  int_ID = Nz(DLookup(&quot;ID&quot;, &quot;Tracking&quot;, &quot;Shift= &quot; &amp; Val(.ShiftCbo) &amp; _
  &quot; And Operator='&quot; &amp; .OpCbo.Column(1) &amp; &quot;' And Date_Field=#&quot; &amp; .DateBox _
  &amp; &quot;# And Machine='&quot; &amp; .MachineCbo.Column(1) &amp; &quot;'&quot;), 0)
  
  End With
  If int_ID &lt;&gt; 0 Then
  
      Dim rst As Recordset
      Dim strID As String
  
      Set rst = Me.RecordsetClone
      strID = CStr(int_ID)
  
      Debug.Print (strID)
      rst.FindFirst &quot;ID='&quot; &amp; strID &amp; &quot;'&quot;
      If rst.NoMatch Then
          GoTo Cleanup
      Else
          Me.Bookmark = rst.Bookmark
      End If
  
  Cleanup:
      rst.Close
      Set rst = Nothing
  End If
  </code></pre>
  <p>When I run this code It appears to go into the NoMatch if statement and I am essentially back to where I started.</p>