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, 2 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
-
File Naming Conventions (including Folders)
by
Magic66
3 hours, 45 minutes ago -
Windows 11 Insider Preview Build 26100.3613 (24H2) released to Release Preview
by
joep517
7 hours, 12 minutes ago -
Microsoft sends emails to Windows 10 users about EOS
by
Alex5723
2 hours, 54 minutes ago -
Outlook 2024 importing Calendar and Contacts – FAILURE
by
Kathy Stevens
1 hour, 38 minutes ago -
Adding Microsoft Account.
by
DaveBRenn
8 hours, 37 minutes ago -
Windows 11 Insider Preview build 26120.3576 released to DEV and BETA
by
joep517
1 day, 8 hours ago -
Windows 11 Insider Preview Build 22635.5090 (23H2) released to BETA
by
joep517
1 day, 8 hours ago -
Windows 11 won’t boot
by
goducks25
1 day, 22 hours ago -
Choosing virtual machine product for Windows on Mac
by
peterb
22 hours, 22 minutes ago -
Rest in Peace
by
Roy Lasris
2 days, 2 hours ago -
CISA : Install Windows March 2025 Updates until April 1 or shut down PC.
by
Alex5723
2 days, 2 hours ago -
Google proposes users with incompatible Win 11 PCs to migrate to ChromeOS Flex
by
Alex5723
2 days, 3 hours ago -
Drivers for Epson Perfection V600 Photo – scanner
by
Bookman
1 day, 7 hours ago -
Long Time Member
by
jackpet
2 days, 6 hours ago -
Woody Leonhard (1951–2025)
by
Will Fastie
1 hour, 27 minutes ago -
What I learned from Woody Leonhard
by
B. Livingston
1 day, 23 hours ago -
Windows Settings today
by
Simon Bisson
2 days, 14 hours ago -
Mail Merge magic in Microsoft Word
by
Peter Deegan
1 hour, 8 minutes ago -
Businesses in the crosshairs
by
Susan Bradley
1 day, 3 hours ago -
Double-row taskbar?
by
CWBillow
1 day, 16 hours ago -
Upgrading non-supported HW to Win 11
by
RetiredGeek
5 hours, 23 minutes ago -
Audio locks up after 15 minutes
by
WSArthurR
4 hours, 54 minutes ago -
Copilot app uninstalled
by
Susan Bradley
3 hours, 6 minutes ago -
Strongbox Password Manager Sold to Applause Group – Cost Escalation Imminent
by
Paul T
4 days ago -
SharePoint
by
CBFPD-Chief115
2 days, 22 hours ago -
Google replacing Google Assistant with Gemini AI assistant
by
Alex5723
4 days, 2 hours ago -
You can no longer stop Alexa from sending voice recordings to Amazon
by
Alex5723
4 days, 3 hours ago -
Meeting Woody in person
by
Susan Bradley
1 hour, 29 minutes ago -
Bear with me – getting some options regarding membership
by
Susan Bradley
30 minutes ago -
Difficulty installing Microsoft Office Home and Business 2024
by
Kathy Stevens
3 days, 23 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.