Locked Subform still lets me delete a record


C

clh

I've got a main "customer" form that displays things like Name and other
general info, then I've got a subform that displays some info in a linked
one-to-many table. The link is based on the "ID" of the user (an auto-number
field in the main "customer" table, just a normal numeric field in the linked
table).

I've set the property on the main form of the subform control to Locked so
the user can't edit the data in the subform.

Indeed, the user is not able to EDIT data, nor able to add new records,
however it DOES allow the user to DELETE a record from the subform. Why?

The subform is used on 2 different main forms. On the other form it is
editable, but on this particular form I want it to be read-only. (Which is
why I don't set the "Allow..." properties on the subform itself.)

Thank you.
 
Ad

Advertisements

A

Amy E. Baggott

On your subform (the form itself, not the subform control on the main form),
set the form's Allow Deletions property (under the Edit tab) to No. That
should take care of it.
 
Ad

Advertisements

C

clh

I won't disagree that your suggestion would probably solve the problem. What
I don't understand is, why does the problem exist in the first place? I
should not have to do what you suggest. The information about the Locked
property in all documentation I can find states, if set to True, "The control
functions normally but doesn't allow editing, adding, or deleting data." It
clearly says "...or deleting data." I can't find anything anywhere that says
anything special about the subform control allowing deleting data.

I don't really want to do what you suggest because, as I stated in my
original post, the same subform is used in 2 different main forms. On one
main form the subform is editable, but on the other main form the subform is
read-only. So with your suggestion I have to write code in the 2nd main form
to set the subform's Allow Deletions property when that 2nd main form opens.
I can do that, but I shouldn't have to. According to all documentation I can
find, I should be able to just set the Locked property on the 2nd main form's
subform control and be good. But it doesn't work.
 

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