Command button to show desktop (1 Viewer)

GregP

Registered User.
Local time
Today, 22:36
Joined
Sep 16, 2002
Messages
66
I have a database being used by several inexperienced users, so have created an instruction sheet as a desktop image. I have a 'Help' button in my database which I want to minimise all windows in order to show the instruction sheet on the desktop, in exactly the same manner as the 'Show Desktop' button works. Is there some internal command in Access which will perform this function (I know there is a built-in macro to 'minimise', but this only affects the active form, not the whole database), or how do I shortcut to a Windows Explorer command? I can probably use some third-party software to create a .exe file containing just that shortcut, but I figure there must be a better way.
 

boblarson

Smeghead
Local time
Today, 05:06
Joined
Jan 12, 2001
Messages
32,059
The command is:

Docmd.RunCommand acCmdAppMinimize

That'll do just what you want: Minimizes the whole Access Environment.
 

GregP

Registered User.
Local time
Today, 22:36
Joined
Sep 16, 2002
Messages
66
Thanks, that did the job, and will do for what I need, because Access will be the only window open at the time. But for interest's sake, if my requirements were different, e.g. if the user had other windows open too, that code will only minimise the Access environment. How about minimising all windows such as in the 'Show Desktop' case?
 
Last edited:

ghudson

Registered User.
Local time
Today, 08:06
Joined
Jun 8, 2002
Messages
6,195
I could not get the Shell function to work with this but FollowHyperlink works but not without a preceeding system message.

Application.FollowHyperlink "C:\WINDOWS\System\Show Desktop.scf"

HTH
 

GregP

Registered User.
Local time
Today, 22:36
Joined
Sep 16, 2002
Messages
66
I did a search on my WINNT directory and couldn't find 'Show Desktop.scf'. The shortcut says it's a 'Windows Explorer Command' (testing on 2K, to be implemented on XP). Does XP have Show Desktop.scf as a separate file? I tried creating a shortcut to the icon and placing that in the form, but it reported some invalid call procedure. How did you get yours to work?
 

ghudson

Registered User.
Local time
Today, 08:06
Joined
Jun 8, 2002
Messages
6,195
Last night I was using my home PC which has Windows 98.

I just searched for Show Desktop.scf on my Windows XP computer and found the file in numerous locations. Here are two of the generic locations...

C:\Documents and Settings\default user\Application Data\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf

C:\Documents and Settings\Administrator\Application Data\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf

HTH
 

GregP

Registered User.
Local time
Today, 22:36
Joined
Sep 16, 2002
Messages
66
Yep, but those directories are the locations of the quick launch bar for different users in Windows Explorer. If you put applications into that directory they'll appear in the quick launch bar. I made a shortcut from there and tried to paste it into Access, which is where I had the problems. Its properties says it's a Windows Explorer command, so I'm guessing it's a command embedded within explorer.exe. Unless there's some way of creating a shell so it can execute the same command from within Access? You said it was in numerous locations - where else is it found?

I would have thought that 'minimise all windows' would have been a fairly common executable windows command. Or that Access would have access to an equivalent through VB or similar?
 
Last edited:

ghudson

Registered User.
Local time
Today, 08:06
Joined
Jun 8, 2002
Messages
6,195
You can copy the Show Desktop.scf shortcut to any location you want. I was able to use the FollowHyperlink method with this line...

Application.FollowHyperlink "C:\WINDOWS\System\Show Desktop.scf"

I just do not like the Windows message you get when using the shortcut from Access and I could not get the Shell function to work with it.

Check out some of the Visual Basic or API forums for there should be some generic code you can use to minimize all open programs.

Here is a good VB site... VBnet - Visual Basic Developers Resource Centre

I have to ask... Why do you want to show the desktop?

You can easily call a Word document using the FollowHyperlink method to open any file to help your users...

Application.FollowHyperlink "C:\Databases\HelpFiles\HelpMe.doc"
 

Users who are viewing this thread

Top Bottom