The code I use is:
Code: Select all
Function IsRecordLocked(ThisID As Long) As Boolean
....
....
Set rst = CurrentDb.OpenRecordset("tblContacts", dbOpenDynaset)
With rst
.FindFirst "[ID]=" & ThisID
If Not .NoMatch Then
.Edit: .Update
Else 'Can't find this person so create error
Err.Raise vbObjectError + 513
End If
End With 'rst
If Err.Number = 0 Then
IsRecordLocked = False
Else
IsRecordLocked = True
End If
Is there a better way? If not how can I make this one work - without actually writing data.