INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Access 2010

How do I hide the database application background shell so only my forms are displayed by 1DMF
Posted: 26 Oct 11 (Edited 3 Jan 12)

If like me you are used to developing many applications in Access and have been used to ticking a box on the startup options in Access 2003, you've probably been pulling your hair out trying to do this simple task in Access 2010.

Firstly I must point out this is not a solution per sae, it is a work round in a specific environment.

MS seem to have made a step backwards with regard to application development in Access 2010 and removed this simple start up option tick box!

So ensure you understand this statement before trying to implement this 'fudge'.

Quote:

Every form in your application MUST be set to 'pop-up' and 'modal' (with the exception of sub-forms)

So if your application requires non-modal forms, you CANNOT hide the Access application DB shell!

OK, so with that in mind, and ensuring ALL your forms are 'modal' simply add the following to the main module (Global Code)

CODE

Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

This declares a function for use from the windows API "user32" library.

Then in your main form of the application add the following to the 'form_open'  form event handler procedure

CODE

    Dim lWin As Long
    lWin = apiShowWindow(Application.hWndAccessApp, 0)

That's it!

It's worth noting you can unhide the DB window with

CODE

    lWin = apiShowWindow(Application.hWndAccessApp, 1)


IMPORTANT NOTICE
Ensure your application has a way of exiting, otherwise you will end up with running background processes of your Access DB!

The easiest way is to put

CODE

Application.Quit

on the 'form_close' event handler of the main application form ensuring that the close button is available on the form!

I then hide/show the main form with

CODE

me.visible = True/False
as appropriate so the main form is only ever closed when the user needs to exit the application.

Of course feel free to use it any way you wish.

Hope this is of use and helps you avoid the wasted hours I spent working all this out!

enjoy 1DMF 2thumbsup


 

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close