M
Malcolm Cook
I'm getting error 2448 when trying to set a forms AllowEdits property in the
following function
Public Function ACForm_propogate_AllowEdits_to_subforms(frm As Access.Form,
Optional EditsImpliesDeletionAddition As Boolean = False)
'Purpose: Recursively descend through the subforms* of <frm>, "inheriting"
the property "AllowEdits", which optionally implies .AllowDeletions
' and .AllowAdditions
Dim subfrm As Access.SubForm
For Each subfrm In ACControlsOfTypes(frm.Controls, acSubform) 'which
returns a collection of all the forms subforms
subfrm.Form.AllowEdits = frm.AllowEdits 'ERROR ON THIS LINE
If EditsImpliesDeletionAddition And frm.AllowEdits Then
With subfrm.Form
.AllowDeletions = .AllowEdits
.AllowAdditions = .AllowEdits
End With
End If
ACForm_propogate_AllowEdits_to_subforms subfrm.Form,
EditsImpliesDeletionAddition
Next
End Function
This is getting called from the form's ON_CURRENT event after the form has
been loaded. The ON_CURRENT is happening while returning to the form after
applying a server filter.
Access 2002 (XP) ADP
Ideas,
Malcolm
following function
Public Function ACForm_propogate_AllowEdits_to_subforms(frm As Access.Form,
Optional EditsImpliesDeletionAddition As Boolean = False)
'Purpose: Recursively descend through the subforms* of <frm>, "inheriting"
the property "AllowEdits", which optionally implies .AllowDeletions
' and .AllowAdditions
Dim subfrm As Access.SubForm
For Each subfrm In ACControlsOfTypes(frm.Controls, acSubform) 'which
returns a collection of all the forms subforms
subfrm.Form.AllowEdits = frm.AllowEdits 'ERROR ON THIS LINE
If EditsImpliesDeletionAddition And frm.AllowEdits Then
With subfrm.Form
.AllowDeletions = .AllowEdits
.AllowAdditions = .AllowEdits
End With
End If
ACForm_propogate_AllowEdits_to_subforms subfrm.Form,
EditsImpliesDeletionAddition
Next
End Function
This is getting called from the form's ON_CURRENT event after the form has
been loaded. The ON_CURRENT is happening while returning to the form after
applying a server filter.
Access 2002 (XP) ADP
Ideas,
Malcolm