calling subroutines from the debug window

  • Thread starter Thread starter placek
  • Start date Start date
P

placek

Hi

Can someone please tell me why it is possible to call a
code module subroutine, but not a form module subroutine?

Martin
 
Gladly.

The module subroutine is an a standard module. This is
visible from anywhere, assuming it is declared Public

Public Sub ExecuteSub()

End Sub

Now, the form module is actually a class Module. It can
not be called by itself, but it can be called through the
Form object, if the form itself is open. Again, the
subroutine has to be declared as public, not private.

Forms("FormName").ExecuteSub



Chris
 
Thanks
I thought that was the case, however i never declared the
subroutine public. Strange, eh?
 
I thought that was the case, however i never declared the
subroutine public. Strange, eh?

Not really. It's clearly documented in help, that Class modules (which
include forms) default to private subroutines. and Module modules default
to public.

B wishes


Tim F
 
Back
Top