Kenneth Ismert
kismert at gmail.com
Wed Jul 1 14:49:01 CDT 2009
A.D., To elaborate on your first test: CallByName Modules("<<ModuleName>>"), "<<CalledProcName>>", VbMethod Modules("ModuleName") returns an Access Module object, which is almost identical to the VBIDE.CodeModule object. So, CallByName(Modules("ModuleName"), "CountOfLines", VbGet) Will return the line count for module ModuleName. Of course, Application.Run only works for uniquely-named public functions. So, if you have Module1.SomeFunc, and Module2.SomeFunc defined, Application.Run "SomeFunc" Will return Error 2157: Microsoft Access can't find the procedure 'SomeFunc.' I haven't found a fix for this. Qualifying the name as "Module1.SomeFunc" or "Module2.SomeFunc" won't help. You can prefix the name of the project, which will let you call code in a library, but that doesn't solve the non-uniquely named function problem. -Ken