I’m trying to hide the Access window on startup using the code specified here but the Access window still comes up.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Hiding the Access Window (2003)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Hiding the Access Window (2003)
- This topic has 12 replies, 4 voices, and was last updated 19 years, 4 months ago.
AuthorTopicWSgrovelli
AskWoody LoungerDecember 14, 2005 at 7:25 am #427386Viewing 1 reply threadAuthorReplies-
WSRudi
AskWoody LoungerDecember 14, 2005 at 7:34 am #990131(Edited by Rudi on 14-Dec-05 10:34. Apologies, i misunderstood you. I was initially under the impression you meant the Database Window. Ignore my reply!)
You do not need code to do this. While in the DB, choose TOOLS | STARTUP. In the Startup dialog, deselect the Display Database Window. This will hide the window at startup.
-
WSHansV
AskWoody LoungerDecember 14, 2005 at 7:48 am #990132This is because you show the Access window immediately after hiding it: the line
fSetAccessWindow SW_SHOWNORMAL
is in the exit section, it will ALWAYS be executed. It should be in the error handling section.
However, I would strongly recommend NOT doing this. In my experience, this code behaves unpredictably. If problems occur, the user may end up with an invisible instance of Access, Explorer may crash, etc.
-
WSgrovelli
AskWoody LoungerDecember 14, 2005 at 7:56 am #990133 -
WSHansV
AskWoody LoungerDecember 15, 2005 at 12:40 am #990134When you are testing code that automates Access from another application, or code that manipulates the Access application window (such as referred to in this thread), you may inadvertently end up with one or more hidden instances of Access. You can check the Processes tab of the Windows Task manager – look for MSACCESS.EXE.
If a database is still open in such an instance, you will see a .ldb file that you can’t delete in the same folder as the database.Here is how you can close a hidden instance of Access:
– Start Word or Excel.
– Open the Visual Basic Editor (Alt+F11).
– Activate the Immediate window (Ctrl+G).
– Type GetObject(, “Access.Application”).Quit and press Enter.
– The .ldb file should disappear from the folder containing the database, indicating that the database has been closed.
– If not, repeat.Note:
You can use the same method to close hidden instances of other Office applications. Instead of “Access.Application”, use “Word.Application”, “Excel.Application” etc. -
WSgrovelli
AskWoody Lounger
-
-
WSDrew
AskWoody LoungerJanuary 3, 2006 at 4:40 pm #992629Okay, here’s the deal. Access 2000 and up act differently then Access 97. In Access 97, you could simply use the ShowWindow API to hide the Main Access Window, and all you had to do, is turn on the Popup Property of your forms.
They made some changes to how they subclass the windows for forms in Access 2000 (and up). Because of this, it was ‘noted’ that you had to also set the Modal Property to Yes, along with the Popup Property.
That is a problem. It works, but having the Modal property on causes a few problems. According to the help : You can use the Modal property to specify whether a form opens as a modal form. When a form opens as a modal form, you must close the form before you can move the focus to another object.
That’s a pain. What good does it do to only let one form open at a time?
A while back, I was on a mission to help someone out with a pet project of theirs. They wanted an Access Form that is ‘Always On Top’. (Like the Task Manager window, above all other windows). Microsoft’s knowledge base lists the way to do this is with a timer on the form, which constantly ‘pushes’ the form to the top…… YECK! . I came up with a better way. No timers, and it works like a charm. In doing so, I discovered a way to get around the Modal property issue.
I am attaching a sample database that I put together for someone. It does a few things. When it opens, you’ll get frmMain. There are buttons for frmOne and frmTwo. frmTwo will open with a different shape. All the forms will appear on the desktop, and there is a ‘Minimize All Forms’ button, which minimizes the forms, and leaves a ‘bar’ in the Status Bar, so that you can click it to return to the forms (and the Main Access Window stays hidden).
Note the tricks to the trade with this: When the main form is closed, it unhides Access (won’t leave ghost Access Applications running….though, you can create a simple routine that unhides hidden Access windows….it’s pretty easy….). When a form opens, it calls the ShowWindow API on itself, which is what gets around the ‘Modal Property’ issue.
Hope this helps!
Drew
-
WSgrovelli
AskWoody Lounger -
WSDrew
AskWoody Lounger -
WSgrovelli
AskWoody Lounger -
WSDrew
AskWoody Lounger -
WSgrovelli
AskWoody Lounger -
WSDrew
AskWoody Lounger
-
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Outdated Laptop
by
jdamkeene
43 minutes ago -
Updating Keepass2Android
by
CBFPD-Chief115
6 hours, 8 minutes ago -
Another big Microsoft layoff
by
Charlie
5 hours, 48 minutes ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
5 hours, 37 minutes ago -
May 2025 updates are out
by
Susan Bradley
6 hours, 13 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
11 hours, 52 minutes ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
11 hours, 54 minutes ago -
Drivers suggested via Windows Update
by
Tex265
11 hours, 45 minutes ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
9 hours, 29 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
18 hours, 45 minutes ago -
Apple releases 18.5
by
Susan Bradley
13 hours, 10 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
20 hours, 11 minutes ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
20 hours, 48 minutes ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
4 hours, 4 minutes ago -
No HP software folders
by
fpefpe
1 day, 4 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 hour, 49 minutes ago -
Stay connected anywhere
by
Peter Deegan
1 day, 9 hours ago -
Copilot, under the table
by
Will Fastie
1 day, 1 hour ago -
The Windows experience
by
Will Fastie
1 day, 16 hours ago -
A tale of two operating systems
by
Susan Bradley
1 day, 7 hours ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 day, 21 hours ago -
Where’s the cache today?
by
Up2you2
2 days, 12 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
2 days, 5 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
1 day, 5 hours ago -
Blocking Search (on task bar) from going to web
by
HenryW
8 hours, 6 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
3 days, 6 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
3 days, 6 hours ago -
regarding april update and may update
by
heybengbeng
3 days, 7 hours ago -
MS Passkey
by
pmruzicka
2 days, 9 hours ago -
Can’t make Opera my default browser
by
bmeacham
3 days, 15 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.