Access 2003 - Immediate window quirk

C

Crawler409

I have been working on VBA for some time now but I just ran across a
problem with my immediate window.

I can run functions normally by utilizing the immediate window only if
the function is residing in a Module. Any functions in the code
behind a form will not run. At first I was getting the "Function not
defined" error, now it just looks like it runs, the cursor goes to the
next line when executing, but nothing actually runs.

Even if I have a public function in the code, I place the cursor
within the function and press the "Play" button on the debug toolbar,
I get nothing.

Hopefully it is a stupid option I have clicked somewhere and it is an
easy fix. It is rather annoying not to be able to run out of the
immediate window.

Thank you in advance!
 
C

Clif McIrvin

[There are accomplished Access developers in these precincts, I've seen
some of their posts.]

Your question is in waters I've never sailed, but I'm guessing it has
something to do with forms being class modules, not standard code
modules.

if you qualify your function with the class object, will it run? Seems
like I've come across references about qualifying function calls but I
didn't take the time to look for where just now. Try something like:

x = Application.Forms("Name of Your Form").YourFunctionName(and
Parameters)
 

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