Sub not defined

texas1992

Registered User.
Local time
Yesterday, 20:19
Joined
May 8, 2012
Messages
25
I have been given the task of reinstating a subroutine that had been removed in the past. The actual subroutine was deleted but the call to the subroutine was commented out.

Now, I have rewritten the subroutine but can't get it to run because when the process gets to the subroutine it throws the error:

Compile error:
Sub or Function not defined.

What could be causing this?
Thanks.
 
You need to place the function in a Module. Not a form or report module but a Standard Module.
 
I'm sorry but I forgot to mention that it is in a module.
 
Then check the spelling of the function. You may have mispelt it.
 
Are you calling another function within the function?

Let's see the code.
 
Call to the sub (this code resides in the form):
Code:
PlaintiffSummaryToWord

Sub (this resides in a module):
Code:
Public Sub PlaintiffSummaryToWord()
 
I was asking to see the entire code. Or upload a stripped down version of your db and I'll take a quick look.
 
Ok, I did a little test where I recreated the sub and just added a few lines and then ran it. I kept doing this until the error message popped up.

It turns out that the problem was an array and not the sub itself.

Thanks for your help and sorry for the inconvenience.
 
It was no inconvenience at all. Glad that's sorted.
 

Users who are viewing this thread

Back
Top Bottom