Colored Background For Windows View in A2016 (1 Viewer)

Status
Not open for further replies.

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 15:41
Joined
Oct 17, 2012
Messages
3,276
Here's something someone might find useful.

I don't know about Access 2013, but in Access 2016, Microsoft, in its infinite wisdom, decided to limit the color themes available in Access. Unlike the rest of the Office suite, there is no longer a color theme available that turns the Access background color to something other than bright white.

My office recently upgraded from Office 2007 to Office 2016, and as a result, a number of my users started reporting serious eye fatigue and even a number of recurring migraines because of this change.

One way to avoid this issue is to switch to using tabs instead of windows, but I dislike this solution both because of aesthetics (I and most of my users HATE the tabbed documents look), and because it takes away some of my control over what users see. Because of that, I wound up coming up with this: a simple background form that automatically sizes itself to fit the display area, and if accidentally clicked, takes steps to ensure it remains in the background.

Here is the code behind the form:

Code:
[COLOR=seagreen]'*********************************************************************************
'** MODULE:         frmBackground
'** CreatedBy:      Scott L Prince
'** CreationDate:   8/4/2018
'** Description:    Provides application background in place of Access White.
'*********************************************************************************
'** THIS FORM AND CODE MAY BY USED FREELY AS LONG AS THIS COMMENT BLOCK REMAINS IN PLACE AND CREDIT GIVEN.
'*********************************************************************************[/COLOR]
Option Compare Database
Option Explicit
 
Private Sub Form_Activate()
    
    [COLOR=seagreen]'Show all OTHER forms that are flagged as visible.[/COLOR]
    Call ShowLoadedScreens
    
End Sub
 
Private Sub Form_Load()
    
    [COLOR=seagreen]'Resize the form.[/COLOR]
    Call SetBackground
    
End Sub
 
Private Sub SetBackground()
[COLOR=seagreen]'*************************************************
'Version:               1.0.0
'Created By:            Scott L Prince
'Date Created:          8/4/2018
'Purpose:               Resizes frmBackground to precisely fit the application window.
'Parameters:            None
'Returns:               N/A
'Dependencies:          None
'Comments:              None
'*************************************************[/COLOR]
Dim WH As Long
Dim WL As Long
Dim WT As Long
Dim WW As Long
 
    With Me
        DoCmd.Maximize
        WT = .WindowTop
        WL = .WindowLeft
        WH = .WindowHeight
        WW = .WindowWidth
        DoCmd.Restore
        Call .Move(WL, WT, WW, WH)
    End With
 
End Sub
 
Private Sub ShowLoadedScreens()
[COLOR=seagreen]'*************************************************
'Version:               1.00.00
'Created By:            Scott L Prince
'Date Created:          8/4/2018
'Purpose:               Displays all OTHER forms flagged as visible.
'                       Displays all opened reports and queries.
'Parameters:            None
'Returns:               N/A
'Dependencies:          None
'Comments:              None
'*************************************************[/COLOR]
Dim frm As Form
Dim rpt As Report
Dim obj As AccessObject
 
    [COLOR=seagreen]'Show all loaded forms that are not this form.[/COLOR]
    For Each frm In Application.Forms
        If frm.Visible And Not (frm.Name = Me.Name) Then frm.SetFocus
    Next
    
    [COLOR=seagreen]'Show all loaded reports.[/COLOR]
    For Each rpt In Application.Reports
        DoCmd.SelectObject acReport, rpt.Name
    Next
    
    [COLOR=seagreen]'Show all open queries.[/COLOR]
    For Each obj In Application.CurrentData.AllQueries
        If obj.IsLoaded Then DoCmd.SelectObject acQuery, obj.Name
    Next
    
ProcExit:

    If Not obj Is Nothing Then Set obj = Nothing
    If Not rpt Is Nothing Then Set rpt = Nothing
    If Not frm Is Nothing Then Set frm = Nothing
    Exit Sub
 
ErrHandler:

    MsgBox "An error has been encountered." & vbCrLf & vbCrLf & _
           "Procedure:" & vbTab & Me.Name & "ShowLoadedScreens" & _
           "Error Number:" & vbTab & Err.Number & vbCrLf & _
           "Description:" & Err.Description, vbCritical, "ERROR"
    Resume ProcExit
 
End Sub
Using it is pretty straightforward:
  • Create a form with the background of your choice. (I went with a light blue because...reasons.)
  • Include this code in the form, and save it.
  • Create a startup procedure in a general module that opens the background form, THEN opens your main menu.
  • Create a macro named AutoExec.
  • In that Macro, use the RunCode action, and have it run your startup procedure.
For those who just want to download and go, I've attached two Access 2016 databases:
  • BGForm.accdb
  • BGFormExample.accdb
The first one contains just the background form and nothing else. The other is a full-blown demo so you can see the implementation.

The databases SHOULD open for Access 2013, but you might be out of luck if you have Access 2007 or 2010. Then again, if you use those earlier versions, then you shouldn't need this form anyway. If you do want to use this anyway, you'll probably need to create your own form and copy my code.

Anyway, this isn't a clever solution to a pressing problem, a much-desired feature not built into Access, or a way to push Access beyond its intended boundaries. It's just something your users may appreciate, especially if any of them get migraines from looking at a white background all day.

As per forum rules, if you have any questions regarding this, you're best off posting a PM. If you do reply to this post, please remember to Report this post with the report icon in the bottom-left corner of the post. This is a moderated forum, and without that, your post may well never be approved.
 

Attachments

  • BGForm.accdb
    476 KB · Views: 456
  • BGFormExample.accdb
    672 KB · Views: 667
Last edited:

isladogs

MVP / VIP
Local time
Today, 19:41
Joined
Jan 14, 2017
Messages
18,186
Just noticed that a recent Office 2016 update has FINALLY added 2 additional colour options (grey & black) so you no longer need the dazzingly bright white background that causes eye strain. I have v1811.



They've also finally got around to fix the very thin border issues that have driven a lot of people to distraction over the past 3 years or so...

List of changes available here: https://support.office.com/en-us/article/update-history-for-office-insider-for-windows-desktop-64bbb317-972a-4933-8b82-cc866f0b067c#InsiderLevel=Insider

However, I still MUCH prefer the A2010 interface
 

Attachments

  • Access Options Office 365 v1811.PNG
    Access Options Office 365 v1811.PNG
    21.5 KB · Views: 935
Last edited:

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 15:41
Joined
Oct 17, 2012
Messages
3,276
Oh, that is really nice to know.

With any luck, IT here will clear that update for distribution here before 2024!
 

isladogs

MVP / VIP
Local time
Today, 19:41
Joined
Jan 14, 2017
Messages
18,186
:)
I tried the black theme for 2 days, then the grey.
Didn't like either and reverted to colourful.

But Access 2010 has a great interface in my opinion
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom