'Invisible' form (1 Viewer)

o1110010

Registered User.
Local time
Today, 14:17
Joined
Mar 6, 2004
Messages
182
What exactly is meant by invisible form? I know I've seen it mentioned a couple times on the forum but I was not able to find those threads now that I have the question. :(


Also, a semi-similar question... I noticed when moving from Access 97 to Access 2000 when using .mdb files.. each form makes another instance on the window's task bar in Access 2000 but they don't do it in Access 97. Is there a way to make form's not show up on the task bar (but still be loaded)?
 

ghudson

Registered User.
Local time
Today, 15:17
Joined
Jun 8, 2002
Messages
6,195
o1110010 said:
Is there a way to make form's not show up on the task bar (but still be loaded)?
I have never seen an invisible form. ;)

Are you referring to a hidden form? A form that is hidden from the window yet accessable from the menu [or VBA].

o1110010 said:
Is there a way to make form's not show up on the task bar (but still be loaded)?
Code:
Application.SetOption "ShowWindowsinTaskbar", False
 
Last edited:

o1110010

Registered User.
Local time
Today, 14:17
Joined
Mar 6, 2004
Messages
182
ghudson said:
I have never seen an invisible form. ;)

Are you referring to a hidden form? A form that is hidden from the window yet accessable from the menu [or VBA].

That sounds right. How does one make a hidden form? So it not only doesn't exist on the taskbar (with your code!) but it's window doesn't appear either. (I'll be searching in the meantime. :))

Thanks.
 

ghudson

Registered User.
Local time
Today, 15:17
Joined
Jun 8, 2002
Messages
6,195
Here is an easy way to open a form as "hidden"...
Code:
DoCmd.OpenForm "YourFormNameHere", acNormal, , , , acHidden
There a a few ways to hide the menu bars and tool bars. Check out this link for where I have posted code do that plus a few other tricks...Hide all Access Toolbars and Menubars

You will learn a lot from this site once you master the forums "search" function. ;)

Good luck!
 

o1110010

Registered User.
Local time
Today, 14:17
Joined
Mar 6, 2004
Messages
182
I know you can set a form to start when the database gets opened with Tools.. Startup.... Is there a way to have this form load as hidden?
 

ghudson

Registered User.
Local time
Today, 15:17
Joined
Jun 8, 2002
Messages
6,195
o1110010 said:
I know you can set a form to start when the database gets opened with Tools.. Startup.... Is there a way to have this form load as hidden?
Not from the startup options.

Code:
Forms![YourFormNameHere].Visible = False
Code:
DoCmd.OpenForm "YourFormNameHere", acNormal, , , , [b]acHidden[/b]
 

o1110010

Registered User.
Local time
Today, 14:17
Joined
Mar 6, 2004
Messages
182
ghudson said:
Not from the startup options.

Code:
Forms![YourFormNameHere].[B]Visible[/B] = False

During the events triggered when opening a form (OnOpen, OnLoad, OnResize, OnActivate, & OnCurrent), Visible is always False.. Or atleast that's what my MsgBox is saying during the events. I was guessing that I could just set it to False to keep it not visible during one of those events but it isn't working.

I know of two likely solutions: 1) Continue to work on this approach of having the first startup form being hidden/invisible and that loads the main menu. 2) Have the main menu be the startup form and then load the form I wish to be hidden when the main menu gets loaded.

I feel #2 is not as efficient as #1 because the main menu can be closed and re-opened quite frequently and I don't want the code in the hidden form to be processed more than once per use.

Any ideas? :confused:


Edit: I have been trying to stay away from macros but I found the command OpenForm where you can open a form as Hidden. I could autoexec that macro command. However, I do not want to go this route unless there is no other solution.. and I believe there must. :cool:
 
Last edited:

Mile-O

Back once again...
Local time
Today, 20:17
Joined
Dec 10, 2002
Messages
11,316
How's this little compromise? (A2002+)
 

Attachments

  • dbCloseMe.zip
    25.1 KB · Views: 144

o1110010

Registered User.
Local time
Today, 14:17
Joined
Mar 6, 2004
Messages
182
Mile-O-Phile said:
How's this little compromise? (A2002+)

Yay! :D I'll probably use this solution.. but.. Is there a way to go about this without a macro?
 

ghudson

Registered User.
Local time
Today, 15:17
Joined
Jun 8, 2002
Messages
6,195
This is how I do it with one of my applications. When the application is first opened, I open the fMainMenu form. In that forms OnOpen event I run this code to check if the fSpecial form is open or not. I open it if it is not open, I do nothing if it is already opened. The second function below needs to be public in a module, not a form module.

Code:
    If IsFormOpen("fSpecial") = False Then
        DoCmd.OpenForm "fSpecial", acNormal, , , acFormReadOnly, acHidden
    Else
        'Do nothing
    End If

Code:
Function IsFormOpen(sFormName As String) As Boolean
On Error GoTo Err_IsFormOpen
    
    IsFormOpen = (SysCmd(acSysCmdGetObjectState, acForm, sFormName) = acObjStateOpen)
    
Exit_IsFormOpen:
    Exit Function
    
Err_IsFormOpen:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_IsFormOpen
    
End Function
 

Users who are viewing this thread

Top Bottom