Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue]Function IsOpenForm(frmName As String) As Boolean
Dim cp As CurrentProject, Frms As Object
Set cp = CurrentProject()
Set Frms = cp.AllForms
If Frms.Item(frmName).IsLoaded Then
If Forms(frmName).CurrentView > 0 Then IsOpenForm = True
End If
Set Frms = Nothing
Set cp = Nothing
End Function[/blue]
[blue] If IsOpenForm("[purple][b]YourFormName[/b][/purple]") Then
[green]'Code if open[/green]
Else
[green]'Code if closed[/green]
End If[/blue]
'There are four states you can check for:
'acObjStateOpen - open
'acObjStateNew - new
'acObjStateDirty - changed but not saved
'0 (zero) - closed or non-existant
If SysCmd(acSysCmdGetObjectState, acForm, "YourFormName") = acObjStateOpen Then
...