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.
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.
This is my 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 = #" & maxlastdate & "# "
Set rst = CurrentDb.OpenRecordset(sql)
LastID = CStr(Val(Mid(rst.Fields(0), 6))) <---- This is where the error happens
End If
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.
Does anyone know why this happens and how i can solve this?
access error 3021. - Ken White