When I'm trying to Delete a record from a table using OnClick button on a Form I always get "Run Time Error 3027" and the Database is not readonly.

Here id the code that I'm using for Delete:

Set rst2 = dbs.OpenRecordset("APPOINTMENT")
del_flag = 0
With rst2
Do Until rst2.EOF
If ![CPR] = Me!CPR Then
del_flag = 1
Exit Do
End If

End With
End If