check if a form is open or loaded 
Author Message
 check if a form is open or loaded

Can anyone tell me if there is anyway to check if a certain form is open /
minimized using VBA?

What I am trying to do is when say, when form 2 is opened check to see if
Form 1 is open (or minimized) if so then "txtbox_Onform2  =  txtbox_OnForm1"
or if form 3 is open (or minimized) then "txtbox_Onform2 = txtbox_OnForm3".

Thanks
Steve



Sun, 15 May 2005 04:56:25 GMT  
 check if a form is open or loaded
Steve:

    If IsLoaded("MyFormName") Then
        '    "MyFormName" is open
    Else
        '    "MyFormName" is not open
    End If

The function "IsLoaded()" is below. Copy it and paste it into a standard
(global) module (NOT the module behind a form or report).

'**********************FUNCTION START
Function IsLoaded(ByVal strFormName As String) As Boolean
 ' 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 = True
        End If
    End If

End Function
'**********************FUNCTION END
:-)
--
Bruce M. Thompson, Microsoft Access MVP

Quote:
>>No Email, Please. Keep all communications

    within the newsgroups so that all might benefit.<<


Quote:
> Can anyone tell me if there is anyway to check if a certain form is open /
> minimized using VBA?

> What I am trying to do is when say, when form 2 is opened check to see if
> Form 1 is open (or minimized) if so then "txtbox_Onform2  =  txtbox_OnForm1"
> or if form 3 is open (or minimized) then "txtbox_Onform2 = txtbox_OnForm3".

> Thanks
> Steve



Sun, 15 May 2005 05:50:59 GMT  
 check if a form is open or loaded
Thanks Bruce, much appreciated
Steveb



Quote:
> Steve:

>     If IsLoaded("MyFormName") Then
>         '    "MyFormName" is open
>     Else
>         '    "MyFormName" is not open
>     End If

> The function "IsLoaded()" is below. Copy it and paste it into a standard
> (global) module (NOT the module behind a form or report).

> '**********************FUNCTION START
> Function IsLoaded(ByVal strFormName As String) As Boolean
>  ' 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 = True
>         End If
>     End If

> End Function
> '**********************FUNCTION END
> :-)
> --
> Bruce M. Thompson, Microsoft Access MVP

> >>No Email, Please. Keep all communications
>     within the newsgroups so that all might benefit.<<



> > Can anyone tell me if there is anyway to check if a certain form is open
/
> > minimized using VBA?

> > What I am trying to do is when say, when form 2 is opened check to see
if
> > Form 1 is open (or minimized) if so then "txtbox_Onform2  =
txtbox_OnForm1"
> > or if form 3 is open (or minimized) then "txtbox_Onform2 =
txtbox_OnForm3".

> > Thanks
> > Steve



Sun, 15 May 2005 14:46:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Checking for Key release on form Load

2. Checking if a form is Loaded/Unloaded

3. Checking If form is loaded

4. Checking to see if a form is loaded

5. CHECK TO SEE IF FORM IS LOADED

6. How can you check if a form is on screen or loaded

7. checking if form is loaded ?

8. AppActive / Checking Loaded Forms!

9. Checking for other loaded forms...

10. How to check if form is loaded or not

11. Checking to see if a form is loaded

12. Checking if a form is loaded.

 

 
Powered by phpBB® Forum Software