Function IsLoaded(ByVal strName As String, ByVal objecttype As Integer) As Boolean '--------------------------------------------------------------------------------------------------------------- 'Northwind.mdbのユーティリティ関数IsLoadedの拡張版です。 'strNameに指定したテーブル、クエリー、フォーム、レポート、マクロ、モジュールが開かれている場合 True を返します。 'objecttypeに acTable ,acQuery,acForm,acReport,acMacro,acModule のいずれかを指定します。 '--------------------------------------------------------------------------------------------------------------- Const conObjStateClosed = 0 Const conDesignView = 0 If SysCmd(acSysCmdGetObjectState, objecttype, strName) <> conObjStateClosed Then If objecttype = acForm Then If Forms(strName).CurrentView <> conDesignView Then IsLoaded = True End If Else IsLoaded = True End If End If End Function