Hiding the MS/ACCESS windows

How can I hide the ms/access 2016 window in runtime?
João serras-pereiraAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
What use-case?

E.g.

Option Compare Database
Option Explicit

Public Enum EnumShowCommand
  scHide = 0
  scShowNormal = 1
  scMaximize = 3
  scShow = 5
  scMinimize = 6
End Enum

Public Declare Function ShowWindow Lib "User32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Sub HideApplicationWindodow()

  ShowWindow Application.hWndAccessApp, scHide

End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeOwner, Developing Solutions LLCCommented:
You can, but it is glitchy, and can leave you with Access open but invisible, with no forms visible either.  If you are going to implement this, make a backup copy of the database before you begin, so you have a working copy to go back to.  It has been years since I used it, but as I recall, all forms have to be Popup (otherwise they are tied to the Access window).

HTH
Dale
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Yes and make sure you have real good error handling before you hide the main window.   Of course this is the run-time, so it's going to fail anyway if you don't.

 But during development, you can get stuck having to do a ctrl/alt/del and end task and loosing a bunch of work.

 I would make backups frequently if you go down this route and would think twice about hiding the main Window.    It (Access) was never designed to have its main window hidden.

Jim.
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What's the reason for this? As the others have said, it's glitchy and rarely works the way you want it to. About the ONLY reason I could ever see to do this sort of thing was if you were creating a kiosk-style application - and even then, you'd be much, much better off using a different platform.

Scott
Neil FlemingConsultant and developerCommented:
I had a lot of success some years ago building an Access front end that used a fullscreen form to mask the main window (ie covered it entirely), rather than trying to hide the main window. The user was prevented from closing this masking window, which was stripped of controls via API calls. The experience was of a custom app, in effect, as all other forms were layered on top of the mask, and also stripped via API calls of their standard form max/min/close controls, and equipped instead with custom close buttons.

That worked well and there were no window-hiding glitsches. Of course, to modify design, it was necessary to disable the code which simply closed the whole Access app if the user "quit" the front end.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Meanwhile ... Peter has some window manipulation functions which I have used without issue - with the precautions noted above.
Check these out:

http://www.peterssoftware.com/winmanip.htm

(free) you and download the sample db and see how it works
João serras-pereiraAuthor Commented:
Well -
I am (sort of) finalising an app and I do want the user to have a clean set of windows (just the forms and nothing else) so I want to get rid of the outer window (everything else is already hidden)
I'll put the sample code in a new Module and let you know
João serras-pereiraAuthor Commented:
wow. what a load of good suggestions!
What I wanted is to have a normal app style like;

I am no big fan of ms/access as
(i) it is a bit limited in some "windows" management",
(ii) lacks two-way web interaction - withe great EE help I successfully used it for GIS, but can't get info back from the web page onto the app
(iii)  is restricted to windows and I want multi-platform (ideally web based) - that will be the future
but
(i) cheap (although I am willing to pay for a good IDE)
(ii) easy
(iii) GREAT reports on PDF
(Iv) great SQL statements from query design (do not know any other
(v) a great collection of low-cost controls (where can I find dbPix/csXImage/videoCaputure for others? Or Tabs?
(vi) lost (sigh) the ability to show a word or PDF INSIDE a farme

Several times I questioned EE on recommendation to switch to alternatives, but that's when everyone really start whistling to the air.. sigh

regarding protection, what I am coding is a split DB and always have, in the BE, a 1 record tblCtrl where I put key parameters (1 per column). I do have a parameter called "Debug". If set to zero, all windows are hidden, if st to 1, they are shown. As I can open the back-end and separately set this field it normally works well.
but thanks for the hints and will let you know - Neil's idea looks great!
João serras-pereiraAuthor Commented:
Hi
Thanks for all the useful comments. I feel bad for not award points to everyone but then it would be a low score for each one.
I will follow advice (back, etc...)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.