Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom menu bar 1

Status
Not open for further replies.

tziviak

Technical User
Oct 10, 2002
128
0
0
US
I have created a custom menu bar and a module to open a specific form but when I put this code in the onAction of the bar-access gives me a message that "The expression you entered has a function name that microsoft access can't find"
here's my code in the onAction:
=ModOpenForm("frmDocsToPrintEI")

and I do have a module with this name ModOpenForm

what am I doing wrong?

thank
 
Is ModOpenForm declared public or private (should be public)?

Public Function ModOpenForm(strFormName as string)
...
End Function
 
Hi,

I will also point out that this code must be a function - a sub will not work. The function doesn't have to return any value; it won't be used anyway.

John
 
sure-here's the code:

Public Function ModOpenForm(strForm As String)

On Error Resume Next

DoCmd.openForm strForm

End Function
 
Hi,

Is the function saved in a module with the same name? If so, try renaming the module as I think Access may be getting confused between the two.

John
 
cool-thanks-I thought they both had to be named the same thing!!
thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top