Application.run does not work with the module

I have two modules. In one module, I want to indirectly use a helper module from another module. According to MS and many online resources, this should work, but it is not. What could be the problem?

'Module: "Helpers"

Public Sub ubTest()
  MsgBox "ubTest is called"
End Sub


'Another Module -> I also tried this from a form and a class...

Public Sub test()
  Dim s As String
  Helpers.ubTest             'works

  s = "ubTest"
  Application.Run s        'works

  s = "Helpers.ubTest"
  Application.Run s        'doesn't work

End Sub

(Obviously, this is a test - in a real application, I will have several modules and will not always have control over the names of the procedures - so I must use the prefix module)

I tried / decompiled and combined the database - there was no luck there either.

+4
source share
1 answer

The Access Application.Run Method help topic says this Name parameter:

' , , ​​: "projectname.procedurename".

, , "modulename.procedurename" (.. "Helpers.ubTest" ) Access , - VBA. Helpers, # 2517, "... " Helpers.ubTest ".

, , , , Application.Run. , "projectname.modulename.procedurename" , 2517.

+2

Source: https://habr.com/ru/post/1526763/


All Articles