first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Access to VB: Use the Visible Property Instead of IsLoaded()

Replace the IsLoaded() function that was available from Microsoft since Access 2.x with the Visible property of the default instance of an Access 97 form. For example, if the form frmMain has a module and is open then

Form_frmMain.Visible = True

Suppose frmMain does not have a module and is open, now frmMain has no default instance because it has no class module. However the Application object is available wherein lies the Forms Collection. It follows that:

Application.Forms("frmKB").Visible = True

This syntax is preferable but the older "bang" syntax still applies:

Forms!frmKB.Visible = True

WARNING: It has been my experience that accessing the Visible property through the Application of object is more reliable than via the default instance of a form. I recommend using the Immediate Window to test both objects (one may return False while the other returns True). I am sure Microsoft is working on this.

mod date: 1998-07-29T00:18:33.000Z