Hi
Here's one I've been meaning to tackle properly for a while. It's a Form/Subform situation where there are events in the subform.
Where an error occurs in the subform (a checkbox click event or whatever) I want to close the form and especially want to run the main form unload sub.
When in the Main form it's easy enough, I have a
DoCmd.Close acForm, Me.Name, acSaveNo
in my error handling.
But waht's the best way of closing both main form and subform when an error occurs in the subform?
I tried just calling
DoCmd.Close acForm, Me.Name, acSaveNo
in the error handler of the subform but this does not close the main.
I tried
DoCmd.Close acForm, Me.parent.form.Name, acSaveNo
but it refuses to run that, I get the End/DeBug prompt
I also tried making my main form close and unload events public and calling them from the error handler of the subform... again Access does not permit this... I get the End/DeBug prompt
Any more ideas anyone... ? thanks
Here's one I've been meaning to tackle properly for a while. It's a Form/Subform situation where there are events in the subform.
Where an error occurs in the subform (a checkbox click event or whatever) I want to close the form and especially want to run the main form unload sub.
When in the Main form it's easy enough, I have a
DoCmd.Close acForm, Me.Name, acSaveNo
in my error handling.
But waht's the best way of closing both main form and subform when an error occurs in the subform?
I tried just calling
DoCmd.Close acForm, Me.Name, acSaveNo
in the error handler of the subform but this does not close the main.
I tried
DoCmd.Close acForm, Me.parent.form.Name, acSaveNo
but it refuses to run that, I get the End/DeBug prompt
I also tried making my main form close and unload events public and calling them from the error handler of the subform... again Access does not permit this... I get the End/DeBug prompt
Any more ideas anyone... ? thanks