Cannot run function from autoexec macro

D

Dorian

Access 2003.
I'm trying to run a function from an autoexec macro and am getting the
message 'access cannot find the function'.
I selected the function from the macros runcode ... prompt via the
expression builder!
Yes its a public function.
Any ideas?
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

Duane Hookom

Do you have two functions with the same name?
Does the function share the same name as a module?
 
D

Douglas J. Steele

Also, is the function in a stand-alone module, as opposed to a class module
(or a module associated with a form or report)?
 
D

Dorian

No to both questions.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

Dorian

I'm not sure what you mean, the function was created in a module that was
created with Modules--New. The type is 'Module'.
It's declared with:
Public Function ClaimsCheck() As Boolean
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

Dorian

If I rename the function to begin with an X, it starts working.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

Duane Hookom

I would try these trouble-shooting steps:
1) open the debug window and test your function
Press Ctrl+G then
? ClaimsCheck()
2) try create a different function that is very simple and place it in your
Autoexec macro
 
J

John W. Vinson

If I rename the function to begin with an X, it starts working.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".

What is (now) the name of the function?
What is the name of the module?
 
D

Douglas J. Steele

That's what I was trying to say: that where the code is stored must have
been created as a Module, not a Class Module.

What did you name the module when you saved it?
 
D

Douglas J. Steele

That implies to me that you may have named the module ClaimsCheck.

As we've been trying to tell you, the name of the module cannot be the same
as the name of any function or sub within the module.
 
D

David W. Fenton

As we've been trying to tell you, the name of the module cannot be
the same as the name of any function or sub within the module.

....or of any public function or sub in any other standalone module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top