Deleting a table entry from a form

E

emanuel.levy

Let me preface this by saying I know enough about Access to be
dangerous but I don't know exactly what I'm doing. Where I work they
have this image of me that if I don't know how to do something I know
how to find out so here I am.

I need to put a button on a form that when you click it deletes the
current record from a table but requires you to enter a password so the
standard users can not delete the information.

How do I do this?

Emanuel
 
R

Rick B

First, you will find that most people don't recommend asking for passwords
everytime you want to do something sensitive. Your users could get into
your code and see the password. Or, they could simply open your table and
delete the record. Or, they could build a query and delete the record.

If you have a database that you share with other and you want to control
what they can and can't do, then you need to implement User-Level Security.
There, You will create userid and passwords for each user. They will enter
their password ONCE when they open the database. They will only have access
to the things they should be allowed to do. If a user can delete
transaction records in one table, but can't delete employee records in
another table, you can set that up. If a Supervisor can add new employee
records, but not delete them, you can do that. If an administrator can
change an employee record, but not add or delete, you can do that.

As far as your question, the button wizard will create a button to delete
the current record, or you can simply use the delete button on the built-in
menu bars. If the user has access to delete a record, then they will be
able to do so. I rarely create a button to do a function that is right
there in the built-in menus.

Setting up ULS is not easy. You must follow every single step IN ORDER. I
would recommend you read the following links at least once, create a backup
or two, then dig in.


Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm
 
Top