How to do Simple Security?

W

WDSnews

In the future, I plan to implement fairly robust security. But today, I
need to scrap together a basic form for one of our volunteers. I thought
I'd create a new frontend with links to a few of the tables. For the most
part, I'll rely on user ignorance and strict verbal instructions to prevent
snooping.

What can I do to prevent accidental deletion of people records? I'm open to
all your suggestions. thanks.
 
M

Mark Andrews

1. You can make the forms so they can't delete records.

2. If you want simple security, my usual approach is to:
- create a login page with username/password that determines which security
group you belong to.
- in code behind the form use the security group to determine what buttons
can be clicked and whether you can add,delete, edit records etc...

You can download my CRM template and read about it in the word document that
comes with it, I believe there is some code showing you how to make things
work in the manual.

3. hide navigation pane or database window and try and make it so users only
use forms

4. to get more advanced, make mde or accde files so poeple can't just hold
down shift to get into the database and muck around.

HTH,
Mark
RPT Software
http://www.rptsoftware.com
 
L

Lynn Trapp

Give the users a dataentry form only and set the Allow Deletions property to
NO.
 
R

Roger Carlson

It's not really security so much as good application design.

One problem I see a lot are forms that have all the records in the table
displayed. These usually show the first record in the recordset and an new
user can start typing in that record, effectively deleting the existing
information. They often do this without realizing it and it's the first
thing I check when I hear a database is "deleting records for no reason".

There are several solutions (there are always multiple solutions for almost
anything in Access).

One is to have two separate forms, the first for adding new records and a
second for editing existing records. You can set the default properties for
the forms (Allow Edits, Allow Additions, Allow Deletions, and Data Entry) in
various ways to achieve what you want. Open the add new form first and have
a button on it to open the editing form. Thus they have to deliberately
push a button to get to the other records. It doesn't stop them so much as
makes it harder to accidentally screw up.

You can also do something similar on a single form if you open it from
another form with the DoCmd.OpenForm command. For instance, if you open the
form with this command:

DoCmd.OpenForm "YourForm", , , , acFormAdd

this will open the form in the AddOnly mode
on this form, add a button with the following code:

Me.DataEntry = False

which will open it back up to seeing all the records.

You could also add code that will open the form to the New Record, which
will allow them to scroll up (or use the record navigation buttons) to go to
and edit previous records. But at least they'll start with an empty record.
To do this, add this code to the On Open event of the form:

DoCmd.GoToRecord , , acNewRec

There are other more complex methods, but these are the quickest and
easiest.


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top