Disable editing in previous MS Access records

By powlboyjr ·
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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Disallow Edits in MS Access

by gsquared In reply to Disable editing in previo ...

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.

Collapse -


by powlboyjr In reply to Disallow Edits in MS Acce ...

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".

Collapse -

Somewhat complex method

by jdmercha In reply to Disable editing in previo ...

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.

Collapse -

The easy way

by Maevinn In reply to Disable editing in previo ...

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.

Collapse -


by powlboyjr In reply to The easy way

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

Collapse -

Glad to help

by Maevinn In reply to Thanks

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

Collapse -

One more question

by powlboyjr In reply to Glad to help

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?

Collapse -

Not available in tables

by Maevinn In reply to One more question

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.

Collapse -

Disallow edits, but for one field

by dermot.downey In reply to Disable editing in previo ...

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

Related Discussions

Related Forums