title: Error 3021 "No current Record"
body: <p>I have an Access file that sits in a folder. That the folder is linked to the company's server. Which means that the Access file can be accessed through every computer in the company.</p>
  
  <p>The problem that i have is that, while i am able to log into the access file from one computer, when i try to log into the same file from a different computer, the error "Error 3021, No Current Record" appears.</p>
  
  <p>This is my code.</p>
  
  <pre><code>'Daily Material Record Code
  sql = "select max(Date_Recorded) from Daily_Material"
  Set rst = CurrentDb.OpenRecordset(sql)
  
  If (rst.EOF Or IsNull(rst.Fields(0))) Then
          lastdate = "01/01/1990"
          LastYear = 1990
          LastID = 0
  Else
          maxlastdate = rst.Fields(0)
          lastdate = DateValue(rst.Fields(0))
          lasttime = TimeValue(rst.Fields(0))
          LastYear = Year(rst.Fields(0))
          'LastID = Val(Mid(rst!ID, 6))
          sql = "select ID from Daily_Material where Date_Recorded = #" &amp; maxlastdate &amp; "# "
          Set rst = CurrentDb.OpenRecordset(sql)
          LastID = CStr(Val(Mid(rst.Fields(0), 6))) &lt;---- This is where the error happens
  
  End If
  </code></pre>
  
  <p>That right there just confused me. Shouldn't there not be an error since i log into the same file from the server? This error only happens when i log into the access file in a different computer.</p>
  
  <p>Does anyone know why this happens and how i can solve this? </p>