I have a main form that has two subforms. In the main form's OnLoad event I have code that references both subforms to set their allow additions, edits, and deletions to true or false depending on certain criteria.
- With Me.sfrmEarlyDisclosures.Form
-
.AllowEdits = False
-
.AllowAdditions = False
-
.AllowDeletions = False
-
End With
-
-
With Me.sfrmAppraisals.Form
-
.AllowEdits = False
-
.AllowAdditions = False
-
.AllowDeletions = False
-
End With
For some reason, I get error code 2467 - "The expression you entered refers to an object that is closed or doesn't exist" when running line 1, but not line 7. Neither subform has records (yet), so that isn't the difference. At first I thought that maybe the subforms didn't load until after the main form's OnLoad event, but then line 7 wouldn't work either. I'm not sure what else to look for setting wise to make it work.