Custom Command Bar

  • Thread starter Thread starter Richard via AccessMonster.com
  • Start date Start date
R

Richard via AccessMonster.com

I have a public function created in a module to open a form. The name of the
module is DataEntry. Here it is:

Option Compare Database
Public Sub DataEntry()

DoCmd.OpenForm "frmPswrdDE"

End Sub


I have created a custom menu bar and in the "onAction" I have the following:


=DataEntry( )


But, I'm getting a message that "The expression you entered has a function
name that Microsoft cannot find"

Can anyone tell me what I'm doing wrong??

Thanks,
Richard
 
You cant give a module and the sub the same name, change the name of the sub
or the module.
 
Richard said:
I have a public function created in a module to open a form. The name
of the module is DataEntry. Here it is:

Option Compare Database
Public Sub DataEntry()

DoCmd.OpenForm "frmPswrdDE"

End Sub


I have created a custom menu bar and in the "onAction" I have the
following:


=DataEntry( )


But, I'm getting a message that "The expression you entered has a
function name that Microsoft cannot find"

Can anyone tell me what I'm doing wrong??

Change your sub into a function (just change the word). Then it should
work. The OnAction property requires the name of a function or a macro. A
sub name doesn't work.
 
Back
Top