Shamil Salakhetdinov
shamil at smsconsulting.spb.ru
Tue Jun 23 12:49:36 CDT 2009
Gustav, Charlotte, Susan, Arthur, I'd suppose that CallByName, which you have mentioned earlier in this thread, would be more appropriate for Arthur's original request: <<< Is there a way to pass the name of a function or procedure to another one? The need for this might occur when the given procedure must branch in various ways, and call a proc/function whose name depends upon the code-path, as it were. >>> As CallByName allows to pass object variables/refs as parameters, and Eval() doesn't allow to do that without some additional tricky VBA programming... BTW, what Arthur is trying to do is known as Abstraction Layer http://en.wikipedia.org/wiki/Abstraction_layer as well as Strategy http://en.wikipedia.org/wiki/Strategy_pattern or Service Locator patterns http://en.wikipedia.org/wiki/Service_locator_pattern which are in turn sub-cases of more generic (OO) programming principle called Inversion of Control: http://en.wikipedia.org/wiki/Inversion_of_Control -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, June 23, 2009 9:17 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Pseudo Pointer to a Function Hi Charlotte Oh my, you are right: http://databaseadvisors.com/pipermail/accessd/2005-June/035493.html /gustav >>> cfoust at infostatsystems.com 23-06-2009 19:06 >>> You can pass it as a string. The problem is you can't call it as a string because the engine doesn't know it's supposed to be a function. I seem to remember a way to use Eval() to handle that, but I may be just losing my mind instead. ;-} Charlotte -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Tuesday, June 23, 2009 8:39 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Pseudo Pointer to a Function I don't know why you couldn't pass the name of the function as a string???? Susan H. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4181 (20090623) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4181 (20090623) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru