Subform updates w/ "Allow Edits" @ No

  • Thread starter Thread starter Scott Ross
  • Start date Start date
S

Scott Ross

I have a form with a Sub form (linked to a different table
as one-to-many to the main table). I want to set the main
form's "Allow Edits" to No, and "Allow Additions" to
Yes...so users can add records, but can't affect the old
records. The problem arises when I set the "Allow Edits"
to No, they can no longer add records through the Sub form.

I can't figure out how to get past this. Is there a way
around it?
 
I don't know if this would help, but you could try setting the main form's
Data Entry property to Yes. However, this will hide any records that exist
prior to the user opening the form. Another possibility may be to reset
AllowEdits to True when the subform gets the focus and set it back to False
when the focus returns to the main form.
 
Unfortunately, I don't want to set the Data Entry to Yes,
because I want them to be able to view past records.

And for some reason, when I try to change the Allow Edits
property when that table geets focus, it won't take effect
unless I'm in Design mode.

Thanks for the help, I'm sure I'll figure a way around it
somehow.
 
I just tried it with the following and it did what you're asking:

Private Sub subform_Enter()
Me.AllowEdits = True
End Sub

Private Sub subform_Exit(Cancel As Integer)
Me.AllowEdits = False
End Sub


Where "subform" is the name of the subform control on the main form. These
are the only 2 events that the subform control offers.
 
Back
Top