| re: CallByName to Module rather than to Form
On 2 May 2005 20:59:31 -0700, "Edlueze" <edlueze@onegen.com> wrote:
[color=blue]
>Great! Eval() works perfectly - I learn something new everyday.
>
>Let me try and help you understand what I'm doing: 99% of the time I am
>using a direct call to the procedure as you suggest. But the remaining
>1% of the time I call the procedure via CallByName. In these situations
>I have a pop-up that can be opened by any one of a number of forms, and
>when that pop-up closes it needs to make a return call to the form that
>opened it. I pass the name of the calling form and return sub routine
>via two strings (actually more because I need to take into account
>parent forms and grandparent forms). This allows me to use the same
>pop-up to gather information in a standard way for lots of different
>calling forms.
>
>I ran into this particularly problem when I tried extending the basic
>workflow to Controlbars. I put the code that manages my Controlbars
>into standard modules rather than into the forms like everything else,
>so the return call needed to be made to the standard module. This is
>where I ran into trouble! The Eval() function now allows me to do this,
>whereas the CallByName only allowed me to make the return call to a
>form.[/color]
Just one more note...
The Eval solution works in Access, and there are similar functions in VBA for
other Office products, but there's no similar function in VB. If you ever
find you want to use CallByName in VB, just arrange for the procedure to be
called to be in a class instance. You can keep an instance of the class in a
global variable contained in a standard module. |