Tres funciones de Juan M. Afan de Ribera para saber si un formulario está cargado
Esta función viene en la Neptuno.mdb (normalmente se instala, no se si por
defecto, en c:\archivos de programa\microsoft
office\office\samples\neptuno.mdb)
Function EstáCargado(ByVal txtNombreFormulario As String) As Boolean
' Devuelve Verdadero si se ha cargado el formulario especificado.
Const conObjetoEstaCerrado = 0
Const conModoDiseño = 0
If SysCmd(acSysCmdGetObjectState, _
acForm, txtNombreFormulario) <> _
conObjetoEstaCerrado Then
If Forms(txtNombreFormulario).CurrentView _
<> conModoDiseño Then
EstáCargado = True
End If
End If
End Function
Otra función para comprobar si un formulario está abierto:
Function EstáCargado2(nomForm As String) As Boolean
Dim frm As Form
Const modoDiseño = 0
On Error GoTo ErrorAlABrir
Set frm = Forms(nomForm)
If frm.CurrentView <> modoDiseño Then _
EstáCargado2 = True
Set frm = Nothing
ErrorAlABrir:
End Function
Y si utilizas Access 2000 o superior, también esto te servirá
Function EstáCargado3(nomForm As String) As Boolean
Dim frm As AccessObject
Const modoDiseño = 0
For Each frm In CurrentProject.AllForms
If frm.Name = nomForm Then
If frm.IsLoaded = True Then
If Forms(frm.Name).CurrentView <> _
modoDiseño Then
EstáCargado3 = True
Exit For
End If
End If
End If
Next
End Function
               (
geocities.com/es/ensolva/Descargas)                   (
geocities.com/es/ensolva)                   (
geocities.com/es)