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
-
89 million Steam account details just got leaked,
by
Alex5723
7 hours, 9 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
7 hours, 18 minutes ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 hour, 44 minutes ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
39 minutes ago -
Installer program can’t read my registry
by
Peobody
15 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
20 hours, 47 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
3 hours, 24 minutes ago -
False error message from eMClient
by
WSSebastian42
18 hours, 25 minutes ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
1 day, 3 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
1 day, 4 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 hour, 18 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
1 day, 8 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
9 hours, 16 minutes ago -
Outdated Laptop
by
jdamkeene
1 day, 13 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
1 day, 19 hours ago -
Another big Microsoft layoff
by
Charlie
1 day, 18 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
22 hours, 10 minutes ago -
May 2025 updates are out
by
Susan Bradley
11 hours, 48 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
2 days ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
2 days ago -
Drivers suggested via Windows Update
by
Tex265
2 days ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
1 day, 22 hours ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 days, 7 hours ago -
Apple releases 18.5
by
Susan Bradley
2 days, 2 hours ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
2 days, 9 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
2 days, 9 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
18 hours, 8 minutes ago -
No HP software folders
by
fpefpe
2 days, 17 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 day, 14 hours ago -
Stay connected anywhere
by
Peter Deegan
2 days, 22 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.