Macro Problems - IsLoaded?

  • Thread starter Thread starter Raistlin
  • Start date Start date
R

Raistlin

Hi Guys,

I'm looking for a little help with a Macro I'm trying to write. Is there
any way to check from within a Macro and see if another form is open. and
then act based upon that information? I've tried the following (it's
possible that my syntax isn't all that great!):

There are 3 IsNull conditions before these lines, they look at controls
within the form and if they are Null they pop up a message box asking the
user to input the information required and then they stop the macro so that
this can be done.
Once all the required fields are populated the following line should run, it
checks to see if another form is open (if it is it produces a message box
giving the user information, if it isn't it just closes the form that's open
and stops the Macro) this is the bit I can't get to work.

CONDITION ACTION

IsLoaded([Forms]![MyForm])=True MsgBox (Gives User Info)
.... Close (Closes
The Form We Are In)
StopMacro

I know this would probably be easier to sort out using code but I'm really
struggling with coding at the moment and find macros a lot easier to sort
out (especially as this is part of a much bigger set of checks/instructions
I really don't want to complicate things more for myself).

Thanks for the help Guys,

Raist.
 
IsLoaded is not a built-in VBA function for ACCESS. The code that you're
trying to use assumes that you have such a function in your database.

Note that IsLoaded function is in the Northwind sample database that comes
with the ACCESS software. To use the IsLoaded function in your database,
first open the Northwind sample database, then copy the function, and paste
it in a module in your database.

To get to this function, open ACCESS, click on Help | Sample Databases |
Northwind Sample Database, go to the database window, click on Modules,
click on Utility Functions, and then click Design icon on toolbar. You'll
see code there for the IsLoaded function. Copy the entire function's code.

Go back to your database, click on Modules, then New. Paste the code into
the module window that opens (under the lines that will appear at the top of
the window). Close and save the module.

You now should be able to call the IsLoaded function as you desire.
 
Hi Ken,

I'm still having problems with this and I wondered if you might help a bit
more.

I've done as you said (saved the IsLoaded function as a module in my App)
but when I try to call it using the following lines in my macro I'm getting
an error message saying that the specified function cannot be found.

CONDITION ACTION

IsLoaded([Forms]![MyForm])=True MsgBox (Gives User Info)
.... Close (Closes
The Form We Are In)
StopMacro


Any thoughts or have I got something really wrong?

Cheers,

Raist.
 
You're welcome.

Raistlin said:
Hi Ken,

You sir, are a star! That worked a treat, I had in fact saved the module
with the same name as the function (as I said right at the start I'm really
not that good with this programming lark, the main thing is that I'm
learning as I go along!).

Thank you very (VERY) much for all your help.

Regards,

Raist.



<SNIP>
 
Back
Top