How can I allow user to edit BUT NOT delete the records in a view?

O

Oldmonkey

Dear all,

Could anybody tell me that how I can allow user to edit BUT NOT delete the
records in a view?

I know there are only 3 options when opening a view:
Add (the user can add new records but can't view or edit existing records),
Edit (the user can view or edit existing records and add/delete new records),
or Read Only (the user can only view records).

The Edit mode will enable Delete command. The delete command is very
dangerous. The users may accidentally delete all the records without
receiving any warning at all. But if I choose to open the view as Read only,
then they can only read but not edit the records.

Does anybody have any idea about how to allow user to edit BUT NOT delete
the records in a view?

Thanks a lot!
 
R

Rick B

Not sure what you mean by "view". Are you in a Form? If so, set the "allow
Deletions" property to "No".

If you are using user-level security, you can also limit a user's ability to
delete records. This is safer since the user can't simply close the form
and open the table directly./

Rick B
 
J

Jeff Boyce

?Opening a view? Do you mean a form?

Forms have 4 properties (Allow Edits, Allow Deletions, Allow Additions, Data
Entry) -- have you tried setting Allow Deletions to No?

Forms have "events" -- like the BeforeDelete event. You can add code that
cancels the deletion in the BeforeDelete event.

Good luck

Jeff Boyce
<Access MVP>
 
O

Oldmonkey

Rick & Jeff, thank you for your reply.
I should have made it more clear. Actually, I have a macro, the action for
this macro is 'OpenView' which open a certain view in the SQL server. But I
know there are only 3 options when opening a view:
Add (the user can add new records but can't view or edit existing records),
Edit (the user can view or edit existing records and add/delete new records),
or Read Only (the user can only view records).

Could you describe in details what's the fastest way to allow user to edit
BUT NOT delete the records in that view I opened in my macro? Thanks again!
 
V

Van T. Dinh

A possible solution: SQL Server has separate Update and Delete permission
on (data displayed in) View. Thus, you can use SQL Server Security to
prevent users from deleting.
 
O

Oldmonkey

Thanks, Van,

I will try that. Is there any other quicker and simpler way to do that?
 
Top