Edit properties of linked subforms problem (repost)

  • Thread starter Thread starter Allen Browne
  • Start date Start date
A

Allen Browne

Instead of setting the AllowEdits property of the form to No, set the Locked
property of each control on the form to No.

That way you will be able to use the subform.
 
I have a tri-level form setup:

-Main Form (user can't add new records)
- Sub Form (Can add new records, but not delete or modify existing records,
linked Child/Master w/ child's default value set to Main Form's Master value
for when new records are added)
- SubSub Form (subform of above subform - can add new records, but not
delete or modify existing records, linked Child/Master w/ child's default
value set to Sub Form's Master value for when new records are added)

The problem is that I don't have the ability to add new records in the
sub-subform unless the "allow edits" property of the Main form and the
parent subform are set to "yes." I don't want people being able to modify
records that have already been entered in ANY of the forms, and only be able
to add new records in the Sub form and the sub-subform.

When I open the sub-subform on its own (using the Database Window's Forms
object window), I can add new records. When I open the main form with the 2
subforms in it, I can't. Something about the "Allow Edits" property being
NO is telling this nested subform that new records can't be added, even
though I have the "Add new records" property set to YES.

Is it possible to have a main form w/ edit and add new set to no, with a
subform w/ edit set to No and addnew set to yes, with a subform of THAT
subform set to edit = No and addnew = yes?

If more details are needed, like the tables and queries that populate each
form/subform, please let me know.

Thanks for any help.

rgrantz
 
You can set the Locked property of the controls in the main form, because
your requirement is to not allow any changes.

In the subform, you could use the Current event of the Form to examine the
NewRecord property of the form. If true, unlock the controls. If False, lock
if unlocked.

The subsubform is easy, because you can set its AllowEdits without affecting
its parents.
 
Allen:

I appreciate the response, but this technique allows users to change records
that have been entered already. I don't want users to be able to modify
already-entered records in any of the 3 forms (Main, Sub, and sub-sub). I
want them to be able to see the already-entered records, but not be able to
change them. I need to do the following:

- Main Form: Can't add, delete, or change data
- Subform (shows records matching child/master link to Main Form): Can't
delete or modify records, but can view them and add new
- SubSubForm (Subform embedded in above subform, linked w/ child/master to
SubForm): Can't delete or modify records, but can view and add new

Right now the only way to allow users to add records in the sub-subform is
to set the Main, Sub, and SubSubsubform AllowEdits to Yes. I don't want
users to be able to change existing data, only add new data (but still see
existing records). As soon as I set the AllowEdits property to No in any of
the 3 forms, the ability to add new records in the sub-subform goes away.
When I set it to Yes, I can add records in the sub-sub form.

I can't lock the fields individually, because users need to enter data for
new records.

I can email this whole mdb to people if they're not familiar with this
issue; you can see what I'm talking about with this form by just setting
that one property back and forth and then looking at form view.

Thanks again, your help is appreciated


rgrantz
 
Back
Top