title: SCOPE_IDENTITY() vs. rs.Fields
body: <p>what is the difference in the way these work:</p>
  
  <pre><code>Sql = "INSERT INTO mytable (datapath, analysistime,reporttime, lastcalib,analystname,reportname,batchstate,instrument) " &amp; _
        "VALUES (dpath, atime, rtime,lcalib,aname,rname,bstate,instrument) SELECT SCOPE_IDENTITY()"
  
  Set rs = cn.Execute
  Set rs = rs.NextRecordset
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>With rs
      .AddNew ' create a new record
      ' add values to each field in the record
      .Fields("datapath") = dpath
      .Fields("analysistime") = atime
      .Fields("reporttime") = rtime
      .Fields("lastcalib") = lcalib
      .Fields("analystname") = aname
      .Fields("reportname") = rname
      .Fields("batchstate") = bstate
      .Fields("instrument") = instrument
  
      .Update ' stores the new record
        id=fields.Fields("rowid")  ' ** Answer to Question ***     
  End With
  </code></pre>
  
  <p>my question is specifically this:</p>
  
  <p>i am in a multiuser environment. immediately after the user adds a record, i need to catch the ROWID of the record added. how do i do this?</p>
  
  <p>this is how i open the recordset:</p>
  
  <pre><code>rs.Open "batchinfo", cn, adOpenKeyset, adLockOptimistic, adCmdTable
  </code></pre>