Laser, good luck with your project. And may I offer this thought. While of course you have to maintain the code and if it is ugly code to get your desired results, it is still far better to have RELIABLE code than EASY code.
Galaxiom said:
The defining factor isn't about where a procedure is called from but where the code is applied.
True, G... and when and to what it is applied. I.e. the whole context of the situation.
My concern is exemplified in a simple question: Inside the called Event code on that other form, if that code uses Me.xxx, where does "Me" point? To the form holding the code that was called or to the form that called the code? "Me" is a dynamic pointer. Remember that in a general module, "Me" has no meaning, even if the public code was called from a form. So is its value bound at run-time or compile-time?
I would also add this question... when calling that other form's event code, if you use screen.activecontrol.xxx constructs inside that event code, they won't point to the form whose code you are running. Will the code references still work since they are not pointing at the called form?
I actually don't know the answer (and don't care since this isn't something I would do) - but the fact that I have to ask should tell you that there is a potential problem.
To be clear, I have MANY times called one event routine from another IN THE SAME FORM! For instance, due to auditing requirements and a department policy on "tell me twice" for anything that was a "deliverable" event, I did not allow navigation off of a dirty form and the navigation buttons would be disabled in that case. Instead I had command buttons for Save and for Undo (Cancel) and a few other functions. I called the event routine for Undo_Click in order to force a form reset if I detected an error condition that the user would not be able to continue, or a restriction / conflict situation. There were OK-Only message boxes explaining the error, so my users were not totally in the dark. (Then again, we WERE government contractors who were like mushrooms...)
So I am NOT saying to not call one event's code from another event. I am just saying that calling another
form's event code is trickier. Mostly due to the context constraints such that "Public" doesn't actually mean "Public" for a form module, and that when you are dealing with implicit instantiation, you are unsure of what the form references. With explicit instantiation and an explicit navigation followed by the call, you would eliminate the issue of uncertainty as to what would be affected.
But as an old fuddy-duddy in programming terms, I still think it is unwise to make that part of your design.