http://support.microsoft.com/kb/299024
I am not new to Access but am very much a beginner with VBA. I pasted the following code from the KB article in a Standard module in my database:
Expand|Select|Wrap|Line Numbers
- '*********************************************************
- 'Declarations section of the module.
- '**********************************************************
- Option Compare Database
- Option Explicit
- Dim LabelBlanks&
- Dim LabelCopies&
- Dim BlankCount&
- Dim CopyCount&
- '==========================================================
- ' The following function will cause an input box to
- ' display when the report is run that prompts the user
- ' for the number of used labels to skip and how many
- ' copies of each label should be printed.
- '===========================================================
- Function LabelSetup ()
- LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"))
- LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"))
- If LabelBlanks& < 0 Then LabelBlanks& = 0
- If LabelCopies& < 1 Then LabelCopies& = 1
- End Function
- (There are other functions in the module as well)
=LabelSetup()
in the OnOpen property of my Labels report to call the function.
When I try to print the report (or see it in Print view), I get the error "Microsoft Access cannot find the object '=LabelSetup().' If '=LabelSetup()' is a new macro or macro group, make sure you have saved it and that you have typed its name correctly."
Here is what I have tried so far:
(1) Double- and triple-checked that the function in the module and the function call are spelled exactly the same
(2) Compacted and repaired the database
(3) Deleted, repasted and recompiled the Standard code module
and I still get the error.
These were all things I did through suggestions from an expert on another forum.
Any other ideas as to why this frustrating thing is happening?
Thanks in advance.
teresedp