Question : Form Cannot Find a Publicly Declared Module-Level Function

I am running Microsoft Office 2007 on a Windows 7 Home Premium 64-bit system.

The database I am working with was created in Office 2003

I have a module named basMenuBars and in that module I created a function called subSetToolbarButton which I want to call from a Form button named "Open" that runs a subroutine internal to the form that opens a report.

However, even though I have declared the subroutine in the module as Public, I still cannot get the form-level open routine to find it. When I try to Compile, I get the message: "Compile error: sub or function not defined."

Why can't my form see this subroutine that has been declared as Public?

Here is the calling code:

1:
2:
Call subSetToolbarButtton("DocMan", True)


Here is the way the subroutine is declared in the module basMenuBars:
1:
2:
Public Sub subSetToolbarButton(strMenu As String, bEnabled As Boolean)

Answer : Form Cannot Find a Publicly Declared Module-Level Function

LOL!!

*HERE* is the 'ghost in the machine':

>> Call subSetToolbarButtton("DocMan", True)

Your original Call statement has three t's in 'Buttton'

{huge grin!}
Random Solutions  
 
programming4us programming4us