Skip to content

Error on the IsLoaded Property

Here’s a way around an error that can sometimes occur with the IsLoaded property.

Q:  Chuck Tucker writes that he is getting an error on the IsLoaded function reference in a code sample from my book, Access 2002 Inside-Out.

A:  IsLoaded is a function that comes with the Access sample Northwind database (among others). Many people already have this function in their databases, or a library database used as a reference in a database, and that is the case with my sample database.  However, when a procedure using the IsLoaded function is imported into a database that lacks this function, it will cause an error.

To avoid this problem, recently I have been using an alternate method, using the new IsLoaded property introduced in Access 2000.  The code is more complex, but it doesn’t require importing the IsLoaded function into the database.  Here is a sample:

   Dim prj As Object

 

   Set prj = Application.CurrentProject

   If prj.AllForms(“fmnuMain”).IsLoaded Then

      Forms![fmnuMain].Visible = True

   Else

      DoCmd.OpenForm “fmnuMain”

   End If

About this author