Mendip Data Systems

Database applications for businesses and schools

LogoTransparent

Control the Application Interface

Version 3.44    Updated 14/08/2019              

 

This example shows how the Access application interface can be controlled in various ways

Some of these methods can be used to help make a database more secure.

 

The database is opened with a form 'floating independently' on the desktop i.e. with the access application window hidden

 

Buttons on the form can be used to:  

   •  drag a borderless form to a new position

  • show / hide entire Access application window

  • show / hide navigation pane

  • show / hide ribbon

  • show / hide taskbar

  • maximise the form to fill the entire screen (no title bar & no taskbar) - this only works for a popup form

  • open another form with a related report. This shows how the print preview ribbon can be displayed whilst the report is open & hidden when it is closed

  • open / close the Visual Basic Editor (VBE)

 

Although it is highly unlikely that any single application would need to use all of these features, this is designed to show that all items can be toggled on / off independently without problems.

 

All code has been fully tested in Access 2010 & 2016 (32-bit & 64-bit) and has been widely used in various production databases for several years.

 

The code used can be found in the modules:

  • modDatabaseWindow / modNavPaneTaskbar / modRibbon

 

Some of the code is widely known e.g. hide navigation pane / ribbon.

Other parts are written by myself or other authors. Where appropriate, those authors have been acknowledged.

 

This example database also includes:

  • code to resize forms for any screen size & resolution in module modResize

  • additional functions in module modDesignFeatures

 

If you wish to use any of the code in your own projects, just copy the relevant module code including all author information as supplied

 

The VBA reference Visual Basic for Extensibility is required for certain additional functions listed in the module modDesignFeatures

e.g. CloseAllVBEWindows and for getting the procedure names in error handling code.

It can be omitted if you don't wish to use either of these

 

UPDATES:

v2.0      09/05/2018 - added code to shows ways of running a query with the application interface hidden

v3.0      02/01/2019 - added code to open a report with the application interface hidden

v.3.2     13/02/2019 - fixed an issue in 64-bit Access

v.3.3     04/04/2019 - added code to allow form to be dragged using mouse down event

v.3.41   19/07/2019 - modified code to prevent application window being restored after clicking on taskbar icon

v.3.44   14/08/2019 - various bug fixes related to code in previous update

 

     

Download SetWindows v3.44      (zipped - approx 2.0 MB)

Click the image to view a larger version ...

Screenshot

Return to Example Databases Page

Example Apps for Businesses, Schools & Personal Use

SetWindows_v3.3

UPDATE 07/09/2019

 

Here are two more variations suggested by various Access forum members but which may be useful to others. Each should work in both 32-bit & 64-bit Access

 

1. Title Bar Only (requested by UA member tina_t via a private message)

The OP wanted the application window to be retained but with the title bar only - no nav pane or ribbons:

 

i) This approach works best with overlapping windows.

ii) The form MUST be a popup

 

2. Remove Title Bar Buttons ( requested by AWF member joeyd11ph in the thread Shutdown PC through Access button[/URL]

 

The OP wanted all buttons removed from the title bar in order to control Access closedown via code only.

 

i) This approach only works with overlapping windows.

ii) The form MUST be a popup with NO control box, close, max/min buttons

iii) To remove the title bar as well, set form border style to None

 

In addition, he wanted to know how to do other actions such as log off or shut down the PC completely using VBA for which I supplied the following code. Place in a standard module

Option Compare Database

Option Explicit

 

'NOTE switches used below

/s = shutdown

/r = reboot

/l = logoff

/f = force apps to close without warning

/t xxx = time delay of xxx seconds e.g. /t 2

 

' ‘*******************SHUT DOWN*********************

Public Function TurnOff()

   

   Shell "shutdown /s /t 2", vbHide

   Application.Quit

End Function

 

' ‘*********************REBOOT***********************

Public Function Reboot()

   Shell "shutdown /r /t 2", vbHide

   Application.Quit

End Function

 

' ‘*********************LOG OFF***********************

Public Function LogOff()

   'omit /t switch or it doesn't work

   Shell "shutdown /l", vbHide

   Application.Quit

End Function

 

'‘**********************FORCE************************

Public Function ForceReboot()

   Shell "shutdown /r /f /t 3", vbHide

   Application.Quit

End Function

Click to download:

TitleBarOnly                         0.5 MB (zipped)

RemoveTitleBarButtons       0.5 MB (zipped)