Protecting old records

  • Thread starter Thread starter Ramesh
  • Start date Start date
R

Ramesh

HI,

I have tables of data which my staff do entry into. Now my concern is that
I d like to protect all the older data from any accidental or deliberate
changes while i still need to allow them to add new data and also make some
changes to recent data. Is there a way i can limit the access to records
beyond a certain time period, say a month?

Also is there any way to protect the data from being copied .. (to be blunt,
stealing)?

Thanks for any inputs.

Ramesh
 
Thanks Rico,

That was a useful link you provided, a lot to learn from.

Just to ensure that my case is clear i d like to re state. My user
currently does not have access to the tables. However through the form they
can see and change all of the data. What i need is that they can see all
the data but only change the recent entered data .. say the last 50 records
or last one month to enable any entry corrections. Is this something i can
do in Access?

I am clear about how to limit editing for all the records and how to stop
viewing of the older records. But this does not help in what i need.

I am sorry if i am being stupid here but i really havent seen anything that
helps here in the little reading i ve done so far.

Thanks for any furhter inputs.

Ramesh
 
Hi ramesh,

Anything is possible with access!

But how you procede depends on how your records are presented. Is your form
in single record view, or in continuous or datasheet view?
 
wow i like your confidence in access .. gives me a boost too! am always
with questions like can i do this and can i do that?

i use both single record and continuous tabular type ... mostly my concern
is with the single record type. but some of them are also tabular where i d
like to them to be able to see the older records but only be able to edit
the new ones.

Ramesh
 
Ramesh,

The issue with tabular style forms is that access can not change the forms
properties for each record when it is displaying them all at once. The only
thing that can change is the colour and text formatting of your fields (see
conditional formating, might be useful to display to users clearly which
records are editable and which are not).

Anyway for the single record view:
Code similar to the following will need to go in the onload and oncurrent
events of your form:
If datediff("m",me.yourdatefield,date()) > 0 then
'here if you dont have many fields you can just do:
Me.field1.enabled = false
Me.field2.enabled = false
'etc
else
Me.field1.enabled = true
Me.field2.enabled = true
'etc
End if

if you have quite a few fields then it might be best to do something more
global like:
Me.allowedits = false
else
Me.allowedits = true

This last option is quicker to code but does not make it obvious to the user
if the record is editable, so some coditional formatting would be required.

For the tabular style, something like the following i would put into the
Beforeinsert event of your form:

If datediff("m",me.yourdatefield,date()) > 0 then
Msgbox "This record is to old to be edited"
Cancel = True
End If


Good luck!

Rico
 
wow. . am amazed at these capabilities of access. could you guide me on
where i could read up on these? or does the last link you sent me cover all
this too?

Thanks a lot ... am inspired to learn a lot more of access.

Ramesh
 
Sorry ramesh,

In the above, the second example should be in the beforeupdate event not the
before insert.
 
I think that last just covers the basics. In the past i've pulled info from
all over the place. Here are a collection of some of my favourite links:

http://www.lebans.com/products.htm
http://www.rogersaccesslibrary.com/TableOfContents3.asp
http://allenbrowne.com/tips.html

If you can spare a bit of cash there are some very good books also:
http://www.amazon.com/Access-2002-D...2907343?ie=UTF8&s=books&qid=1172847802&sr=8-4

The sample Northwind database is a very good example of how it should be
done. Goto Help > Sample Databases. And the help in access actually aint that
bad for a microsoft product.

Enjoy!

Rico
 

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

Back
Top