[AccessD] Pseudo Pointer to a Function

A.D.Tejpal adtp at airtelmail.in
Thu Jul 2 00:12:18 CDT 2009


    Thanks Ken! - for the interesting findings, enhancing the overall coverage of this thread for future reference.

Best wishes,
A.D. Tejpal
------------

  ----- Original Message ----- 
  From: Kenneth Ismert 
  To: accessd at databaseadvisors.com 
  Sent: Thursday, July 02, 2009 01:19
  Subject: Re: [AccessD] Pseudo Pointer to a Function


  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


More information about the AccessD mailing list