René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

iterate_modules [Access macro]

' run insert_module first
option explicit

public sub iterate_modules()

  dim ac        as access.application
' dim db        as dao.database

  dim vb_editor as vbide.vbe
  dim vb_proj   as vbide.vbProject
  dim vb_comp   as vbide.vbComponents
  dim vb_module as vbide.vbComponent

  dim mdb_name  as string
      mdb_name = "c:\temp\inserted_module.mdb"

  dim module_name as string
      module_name = "ThisModuleWasInserted"

  set ac = new access.application
  ac.openCurrentDatabase(mdb_name)
' set db = ac.currentDB

  set vb_editor = ac.vbe
  set vb_proj   = vb_editor.activeVBProject
  set vb_comp   = vb_proj.vbComponents

  for each vb_module in vb_comp 
     msgBox(vb_module.name)
  next vb_module

' set vb_module = vb_comp(module_name)

end sub