Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-18-2019, 04:00 AM   #1
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Keep Access Application Minimized

Hi,

Just for curiosity.

Is it possible to keep Main Access app window minimized and run just forms?.

Have found code with "Function GetSystemMenu Lib ďuser32″", but option don't work, not fully understand why though.

Also found that you can choose "Tabbed Documents", deselect "Display Documents Tabs" in Options --> Current Database and on open form event put code lines
Code:
    
Private Sub Form_Open(Cancel As Integer)

    DoCmd.RunCommand acCmdAppMinimize
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    
End Sub
but problem with this is that when its minimized and you click on application icon in Taskbar it maximizes.

Any thoughts?

Thanks

Juolupuki is offline   Reply With Quote
Old 07-18-2019, 04:32 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,581
Thanks: 58
Thanked 1,443 Times in 1,424 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Keep Access Application Minimized

Hi. There is an API code to hide the Access shell available somewhere but I never really bothered using it because of all the extra efforts involved.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
Juolupuki (07-18-2019)
Old 07-18-2019, 04:37 AM   #3
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Re: Keep Access Application Minimized

Quote:
Originally Posted by theDBguy View Post
Hi. There is an API code to hide the Access shell available somewhere but I never really bothered using it because of all the extra efforts involved.
Yep there is just the line not work :/

Code:
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long

Full code...

Code:
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long

Function fSetAccessWindow(nCmdShow As Long)

Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm

If Err <> 0 Then
    loX = apiShowWindow(hWndAccessApp, nCmdShow)
    Err.Clear
End If

If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
    MsgBox "Cannot minimize Access with " _
    & (loForm.Caption + " ") _
    & "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
    MsgBox "Cannot hide Access with " _
    & (loForm.Caption + " ") _
    & "form on screen"
Else
    loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
fSetAccessWindow = (loX <> 0)

End Function

Juolupuki is offline   Reply With Quote
Old 07-18-2019, 05:42 AM   #4
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,316
Thanks: 115
Thanked 3,098 Times in 2,816 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Keep Access Application Minimized

Have a look at my example app https://www.access-programmers.co.uk...d.php?t=293584
It uses code similar to what you've shown.

On this occasion I'm going to disagree with the DBG as its easy to use
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Juolupuki (07-19-2019)
Old 07-18-2019, 05:43 AM   #5
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,729
Thanks: 93
Thanked 1,714 Times in 1,587 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Keep Access Application Minimized

The problem is partly Windows and partly Access.

When you open an application in Windows, you open a window and attach it as the primary display/interaction area. If you minimize the window, the app is still running. But the moment it needs an interaction (like a button click or typing into a text box) you must have a Window that can bring that active thing into focus. Because, after all, Windows is all about GRAPHIC (i.e. visual) interactions. Minimized window = no graphics.

This is where Access has a finger in the pie. All of the stuff you create in Access is normally part of a CHILD window, not an independent window. (It's all part of the app window you created when you launched Access.) So you can't easily expand the child if the parent is not expanded. I.e. in a graphic interface, if you can't see it, you can't interact with it, parent OR child.

The behavior you describe is normal (default) Windows behavior (not necessarily Access-originated). There are ways to override this, but what I described is the default behavior of any app that has child windows.

The approach that many of us will use (not all of us by any means) is that we limit the visibility of the design-window infrastructure by putting up some sort of opening form that covers up everything. This particular window does sizing control on its own, and don't forget that forms have usable events for size changes in case the user tries to drag the window size to change it.

We put command buttons on this form so that you can open up forms or reports from it like a control panel. Then when you open something, we use the Windows option to "Bring to Front" so that the new thing is on top and you work in that window. When you are done, you close that item and the window dissolves, sending you back to the control panel form again.

So my question is, do you really want to hide access itself or were you just trying to keep people from diddling? Because you CAN make the control panel completely fill the Access window, hide the ribbon, and control other features to make it look like Access isn't there but your app IS there. In a graphic environment, if Access is hidden by something on top of it, it could easily become "out of sight, out of mind." So what was your real goal? Answer that and you will have a better idea of where to go from here.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 07-18-2019, 06:36 AM   #6
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,581
Thanks: 58
Thanked 1,443 Times in 1,424 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Keep Access Application Minimized

Quote:
Originally Posted by isladogs View Post
Have a look at my example app https://www.access-programmers.co.uk...d.php?t=293584
It uses code similar to what you've shown.

On this occasion I'm going to disagree with the DBG as its easy to use
It's easy for you because you're smarter than me. Besides, I am too lazy to chase all the quirks around. Luckily, I haven't had a need to do something like it, or I'll be in trouble.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 07-18-2019, 07:25 AM   #7
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,316
Thanks: 115
Thanked 3,098 Times in 2,816 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Keep Access Application Minimized

Quote:
Originally Posted by theDBguy View Post
It's easy for you because you're smarter than me.
Haha. Going to disagree with you about that statement as well
Seriously though there aren't any major quirks involved.

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
Old 07-19-2019, 01:45 AM   #8
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Re: Keep Access Application Minimized

Quote:
Originally Posted by The_Doc_Man View Post
The problem is partly Windows and partly Access.

When you open an application in Windows, you open a window and attach it as the primary display/interaction area. If you minimize the window, the app is still running. But the moment it needs an interaction (like a button click or typing into a text box) you must have a Window that can bring that active thing into focus. Because, after all, Windows is all about GRAPHIC (i.e. visual) interactions. Minimized window = no graphics.

This is where Access has a finger in the pie. All of the stuff you create in Access is normally part of a CHILD window, not an independent window. (It's all part of the app window you created when you launched Access.) So you can't easily expand the child if the parent is not expanded. I.e. in a graphic interface, if you can't see it, you can't interact with it, parent OR child.

The behavior you describe is normal (default) Windows behavior (not necessarily Access-originated). There are ways to override this, but what I described is the default behavior of any app that has child windows.

The approach that many of us will use (not all of us by any means) is that we limit the visibility of the design-window infrastructure by putting up some sort of opening form that covers up everything. This particular window does sizing control on its own, and don't forget that forms have usable events for size changes in case the user tries to drag the window size to change it.

We put command buttons on this form so that you can open up forms or reports from it like a control panel. Then when you open something, we use the Windows option to "Bring to Front" so that the new thing is on top and you work in that window. When you are done, you close that item and the window dissolves, sending you back to the control panel form again.

So my question is, do you really want to hide access itself or were you just trying to keep people from diddling? Because you CAN make the control panel completely fill the Access window, hide the ribbon, and control other features to make it look like Access isn't there but your app IS there. In a graphic environment, if Access is hidden by something on top of it, it could easily become "out of sight, out of mind." So what was your real goal? Answer that and you will have a better idea of where to go from here.
Thanks for the explaining it.

I have originally hided the main app screen with form which maximized as a background for my DB and then loads on top login screen or other forms. All forms set as Pop Up and modal, so user cant do anything else just interact with forms.

The reasons why i would like to change the look is that the DB background is covering everything on screen (even the toolbar) and some users don't know that to access anything else behind it needs to press Windows button, also the actual DB would look a bit more nicely . As well I'm
Quote:
trying to keep people from diddling?
basically all in one.
Juolupuki is offline   Reply With Quote
Old 07-19-2019, 02:31 AM   #9
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Re: Keep Access Application Minimized

Quote:
Originally Posted by isladogs View Post
Have a look at my example app https://www.access-programmers.co.uk...d.php?t=293584
It uses code similar to what you've shown.

On this occasion I'm going to disagree with the DBG as its easy to use
Thank a lot that. That's nice peace of code .

Unfortunately it acts exactly as with what i have achieved, if you press on application in toolbar it will maximize.

I guess that's what The_Dog_Man talk about, windows and other applications interacts.
Juolupuki is offline   Reply With Quote
Old 07-19-2019, 03:46 AM   #10
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,316
Thanks: 115
Thanked 3,098 Times in 2,816 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Keep Access Application Minimized

Quote:
Originally Posted by Juolupuki View Post
Thank a lot that. That's nice peace of code .

Unfortunately it acts exactly as with what i have achieved, if you press on application in toolbar it will maximize.

I guess that's what The_Dog_Man talk about, windows and other applications interacts.
I have a newer version that fixes that. Iíve only tested it in 32-bit Access so far.
Can post this evening UK time when Iím back home
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
Old 07-19-2019, 05:00 AM   #11
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Re: Keep Access Application Minimized

Quote:
Originally Posted by isladogs View Post
I have a newer version that fixes that. Iíve only tested it in 32-bit Access so far.
Can post this evening UK time when Iím back home
That's great, but I'm afraid 32-bit will not work for me all machines are on 64 :/.
Juolupuki is offline   Reply With Quote
Old 07-19-2019, 06:59 AM   #12
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,316
Thanks: 115
Thanked 3,098 Times in 2,816 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Keep Access Application Minimized

I'll test it in 64-bit later today and let you know
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
Old 07-19-2019, 07:01 AM   #13
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,581
Thanks: 58
Thanked 1,443 Times in 1,424 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Keep Access Application Minimized

Quote:
Originally Posted by Juolupuki View Post
That's great, but I'm afraid 32-bit will not work for me all machines are on 64 :/.
Hi. Just asking for some clarification here... Are you saying all machines are using 64-bit version of Access? Or, are you just saying all machines have a 64-bit version of Windows? Thanks!
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 07-19-2019, 08:08 AM   #14
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,316
Thanks: 115
Thanked 3,098 Times in 2,816 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Keep Access Application Minimized

Good news. I've just successfully tested the updated version of my app in 64-bit Access and have uploaded it to sample databases:
https://www.access-programmers.co.uk...6&postcount=14

Quote:
The new version fixes a long standing issue that has been requested several times.
It has been tested in both 32-bit and 64-bit Access
Previously if the app was open but another window had focus, clicking the taskbar icon would restore the application window
That no longer occurs.
Hopefully that has fixed the issue you had
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
Old 07-19-2019, 08:42 PM   #15
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Keep Access Application Minimized

only 1 comment, when you hide the app window and click to unhide it the ribbon is gone also the nav pane.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access minimized to system tray Novice1 Forms 3 04-27-2018 01:24 AM
Form not visible when access window is minimized ChrisBrook Forms 2 11-28-2016 03:49 PM
Open the another access file in minimized or hidden kowol Modules & VBA 4 05-20-2013 04:25 PM
Keep Access Minimized Vassago General 5 04-24-2003 12:08 PM
Start Access Minimized GregSmith Forms 1 07-02-2002 07:10 PM




All times are GMT -8. The time now is 09:25 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World