Question Locked

Disable editing in previous MS Access records

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Here is the situation. One of our departments uses a MS Access 2003 database. We want to disable editing of previous entries in one of our forms. Seems rather easy, but I just can't seem how to do it. Thanks for the help.

10 replies

by gsquared

You can use an OnLoad event to set the AllowEdits property of the form.

Open the form in Edit view, go to the form properties, add an On Load VB event, create a script like:

if not isnull(me!id.value) then
Me.AllowEdits = false
end if

Use whatever field would indicate this is a record that shouldn't be edited. I used "id" in my example, and "not isnull" as the criteria, but you can use any field and any value. "If me!dateadded < now() - 30 then" would make it so records added more then 30 days ago couldn't be edited, for example.

If you have other questions on this, please feel free to ask.

by powlboyjr

Will this script allow entries of new records into the same field? Also, could I get a little more step by step instructions. I don't have an onLoad event called "AllowEdits".

by jdmercha

Create a seperate form for entering data. The form fields would not be tied to the table. Provide a "Submit" button that will send the data from the form to the table.

A second form can be used to view data and not allow edits.

by maevinn

In the form properties window, All or Data tab, set Allow Edits to No, Allow Additions to yes. You can also decide if they can delete records, which at a guess is no.

by powlboyjr

That worked perfect. I'm a little embarrased I didn't see that option, but I know for sure now. Thanks for the help.

by maevinn

Don't worry about it--I spend WAY too much time working in Access. :)

by powlboyjr

I can still go into the table that the form stores the records in and delete the records. I looked for a similar property, but I can't find anything. Any suggestions?

by maevinn

That's something only for forms. If you need to prevent users from deleting through tables (which, IMO, shouldn't even be visible to users--no good comes from users mucking about in tables!) you have to do it through securing the database and using Security Permissions.

by dermot.downey

Can an Access 2003 database be made so that edits are allowed for some fields and not for others?

This discussion is closed to new replies.