How to make form to accept new data but no change for old data?

S

steve

Im using a datasheet view to look at two tables. I dont know how to
make it so that I can only add data into both of these datasheets but
not be able to change previous data.

How can I do this in a datasheet view and a form view. I asume its a
property somewhere? I can get it so I cant add or change anything but
not the combination I mentioned above.

(Access 2002)

Thanks.
 
A

Al Campagna

steve,
As you probably know, you shouldn't be updating any data directly
through the tables. Always build a form to do that.
And... that form's Data Entry property, when set to YES, will only
allow new records to be added to the table. You would not be able to
access any previously entered records through that form.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
H

Hans Up

steve said:
Im using a datasheet view to look at two tables. I dont know how to
make it so that I can only add data into both of these datasheets but
not be able to change previous data.

How can I do this in a datasheet view and a form view. I asume its a
property somewhere? I can get it so I cant add or change anything but
not the combination I mentioned above.

Assuming you're talking about a form in datasheet view, you can set the
form's properties (on the "Data" tab of the property sheet) to:

Allow Edits No
Allow Deletions No
Allow Additions Yes

If you want the users to see (but not be able to modify or delete)
existing records, set the Data Entry property to No. If you do not want
them to view previous records --- only add new --- set Data Entry to Yes.

If your goal includes similar restrictions when directly opening tables
(not within a form), the usual answer is "Don't do that!" Your users
should interact with the data only through forms ... not table (or
query) datasheets.
 
S

steve

Thanks for your help.

I have followed the instructions
Allow Edits No
Allow Deletions No
Allow Additions Yes

If you want the users to see (but not be able to modify or delete)
existing records, set the Data Entry property to No. If you do not want
them to view previous records --- only add new --- set Data Entry to Yes.

No
No
Yes
Yes

but when I look at the datasheet it does not show me any previous
records, which I want people to see because, well they need to. Any
thoughts?

Regards
 
H

Hans Up

steve said:
Thanks for your help.

I have followed the instructions

No
No
Yes
Yes

but when I look at the datasheet it does not show me any previous
records, which I want people to see because, well they need to. Any
thoughts?

Set the Data Entry property to No.
 
S

steve

This does not seem to work completly.
Perhaps hard to explain but this form has another form in it, that
displays another table. I can set the settings of the form in the
smaller form as you have described, and indeed I cannot change any
data but can add data. However as soon as I set the 'do not edit' on
the larger fform that contains the smaller form, the ability to add
new records on the smaller form (what I call the sub form),
disapears.

Any advice?
 
H

Hans Up

steve said:
This does not seem to work completly.
Perhaps hard to explain but this form has another form in it, that
displays another table. I can set the settings of the form in the
smaller form as you have described, and indeed I cannot change any
data but can add data. However as soon as I set the 'do not edit' on
the larger fform that contains the smaller form, the ability to add
new records on the smaller form (what I call the sub form),
disapears.

Any advice?

Maybe don't set 'do not edit' on the parent form so the subform will
behave as you want. Then, for the other controls on the parent form,
set them to Locked = Yes and Enabled = No. Not sure sure if that would
fit your need. And there may a better way ... but I'm not seeing it.
 
S

steve

It seems no matter how I set it this does not work perfectly.
I guess there is no way to set it on an individual field basis in the
form, rather than set it for the whole document?

Regards
 
H

Hans Up

steve said:
It seems no matter how I set it this does not work perfectly.
I guess there is no way to set it on an individual field basis in the
form, rather than set it for the whole document?

My form's data source is a query which includes a field named "lname".
On the form is a text box named "txtlname" which is bound to the lname
field. When I change txtlname properties to Enabled = No and Locked =
Yes, I can see the data contained in the lname field ... but I can't get
at it to change the value ... it's sort of like read-only on the form.

What else did you have in mind for "set it on an individual field basis
in the form"?
 
S

steve

I see what your saying, I guess Im just trying to resolve the problem.
For some reason you can make the second form the way I want it but not
the first. I will have to try to do some research and see if I can do
it some other way. Thanks.
 

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