R
Richard
For development and debugging purposes,
Is it possible for a form to use the Parent property to test if it is
being used 'stand-alone' versus embedded in another form ?
Question arise in part for this situation.
A form dynamically lays itself out vertically based on the row counts
of several subforms.
When a record of a subform is deleted, the parent form should run its
dynamic layout again.
I could swear this was working, but it is not now (sandbox issues
maybe?)
private sub Form_Load
subform1.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform2.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform3.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform4.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform5.form.onAfterDel = "=Parent.Form.ComputeLayout"
end sub
Public Function ComputeLayout()
....
.... algorithmically layout subform controls based on record counts
....
end sub
When a record is deleted, Access throws a dialog "The expression
AfterDelConfirm you entered as the event property setting produced the
following error: Microsoft Access can't find the field 'ComputeLayout'
referred to in your expression"
In an experiment I had .onAfterDel is "=MsgBox(Parent.Form.Caption)"
and things worked fine.
Is it possible for a form to use the Parent property to test if it is
being used 'stand-alone' versus embedded in another form ?
Question arise in part for this situation.
A form dynamically lays itself out vertically based on the row counts
of several subforms.
When a record of a subform is deleted, the parent form should run its
dynamic layout again.
I could swear this was working, but it is not now (sandbox issues
maybe?)
private sub Form_Load
subform1.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform2.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform3.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform4.form.onAfterDel = "=Parent.Form.ComputeLayout"
subform5.form.onAfterDel = "=Parent.Form.ComputeLayout"
end sub
Public Function ComputeLayout()
....
.... algorithmically layout subform controls based on record counts
....
end sub
When a record is deleted, Access throws a dialog "The expression
AfterDelConfirm you entered as the event property setting produced the
following error: Microsoft Access can't find the field 'ComputeLayout'
referred to in your expression"
In an experiment I had .onAfterDel is "=MsgBox(Parent.Form.Caption)"
and things worked fine.