You might try.Need to do a loop to check all the forms
Function IsLoaded(ByVal strFormName As String) As String
' Returns True if the specified form is open in Form view or Datasheet
view.
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <conDesignView Then
IsLoaded = "Open"
Else
IsLoaded = "Design View"
End If
End If
End Function
Phil
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48***********************@per-qv1-newsreader-01.iinet.net.au...
This would tell you if the form is open and in design view:
strForm = "Form1"
If CurrentProject.AllForms(strForm).IsLoaded Then
Debug.Print Forms(strForm).CurrentView = 0
End If
Won't work for subforms.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"MLH" <CR**@NorthState.netwrote in message
news:q6********************************@4ax.com...
>An A97 application that sometimes stays open for days
at a time may have a form, report, table or query open
in design view. What's the simplest code snippet that
would determine whether any database object was
currently open in design view?