Allowing additions but not deletions

  • Thread starter Thread starter Derek
  • Start date Start date
D

Derek

I have created a database and set up the security for it
using the security wizard. This database is shared over a
LAN. The one problem I have is that the users will be
entering info but will have to come back at a later time
to complete the certain fields in each record. With the
permissions they have, they are not able to come back and
add the remaining data. I don't want to change their
permissions because I don't want them to be able to delete
any data. Is there any way I can set their permissions to
allow them to add to the remaining fields but not delete
any existing fields?
 
If the fields that the user must complete at a later time
are always the same fields, you could just put these
fields on their own form.
 
Is there any way I can set their permissions to
allow them to add to the remaining fields but not delete
any existing fields?

You'ld need some VBA to do this - updating an existing record to set a
field to NULL isn't really "deleting" anything in Access' terms.

You would want to put code in each such control's BeforeUpdate event
to trap any attempt to erase the content of the field (air code,
untested):

Private Sub controlname_BeforeUpdate(Cancel as Integer)
If Me!controlname.OldValue & "" <> "" Then 'was there data before?
If Me!controlname.Text = "" Then
MsgBox "You can't remove data that's been entered!", vbOKOnly
Cancel = True
Me!controlname.Undo
End If
End If
End Sub
 
Back
Top