Go Back   Access World Forums > Microsoft Access Reference > Code Repository

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-06-2018, 09:52 AM   #1
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 2,931
Thanks: 75
Thanked 406 Times in 366 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Colored Background For Windows View in A2016

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:
'*********************************************************************************
'** 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.
'*********************************************************************************
Option Compare Database
Option Explicit
 
Private Sub Form_Activate()
    
    'Show all OTHER forms that are flagged as visible.
    Call ShowLoadedScreens
    
End Sub
 
Private Sub Form_Load()
    
    'Resize the form.
    Call SetBackground
    
End Sub
 
Private Sub SetBackground()
'*************************************************
'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
'*************************************************
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()
'*************************************************
'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
'*************************************************
Dim frm As Form
Dim rpt As Report
Dim obj As AccessObject
 
    'Show all loaded forms that are not this form.
    For Each frm In Application.Forms
        If frm.Visible And Not (frm.Name = Me.Name) Then frm.SetFocus
    Next
    
    'Show all loaded reports.
    For Each rpt In Application.Reports
        DoCmd.SelectObject acReport, rpt.Name
    Next
    
    'Show all open queries.
    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.
Attached Files
File Type: accdb BGForm.accdb (476.0 KB, 31 views)
File Type: accdb BGFormExample.accdb (672.0 KB, 49 views)

__________________
This is a test.
This is only a test.
If this were a real emergency, you would NOT have been informed, and we would have fled screaming in terror.

Last edited by Frothingslosh; 08-06-2018 at 11:31 AM.
Frothingslosh is offline   Reply With Quote
Old 10-27-2018, 04:33 PM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 6,899
Thanks: 92
Thanked 1,694 Times in 1,572 Posts
isladogs is just really nice isladogs is just really nice isladogs is just really nice isladogs is just really nice isladogs is just really nice
Re: Colored Background For Windows View in A2016

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/art...rLevel=Insider

However, I still MUCH prefer the A2010 interface
Attached Images
File Type: png Access Options Office 365 v1811.PNG (21.5 KB, 67 views)
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Previously known as ridders : Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by isladogs; 10-27-2018 at 04:44 PM.
isladogs is offline   Reply With Quote
Old 11-01-2018, 12:55 PM   #3
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 2,931
Thanks: 75
Thanked 406 Times in 366 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Re: Colored Background For Windows View in A2016

Oh, that is really nice to know.

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

__________________
This is a test.
This is only a test.
If this were a real emergency, you would NOT have been informed, and we would have fled screaming in terror.
Frothingslosh is offline   Reply With Quote
Old 11-01-2018, 01:02 PM   #4
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 6,899
Thanks: 92
Thanked 1,694 Times in 1,572 Posts
isladogs is just really nice isladogs is just really nice isladogs is just really nice isladogs is just really nice isladogs is just really nice
Re: Colored Background For Windows View in A2016


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

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Previously known as ridders : Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Reply

Tags
background color , backgrounds , form

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Yes / No Field check mark A2016 Dick7Access Forms 3 01-11-2017 03:27 PM
Windows Explorer background colour StephenSLR Windows 0 01-04-2010 06:06 PM
change background picture of access windows marianne General 4 04-23-2009 09:56 PM
need help to invoke windows explorer in background from excel using VBA SK-2006 Modules & VBA 2 06-08-2007 07:47 PM
Can't view fields with background color esskaykay Forms 4 02-08-2005 07:44 AM




All times are GMT -8. The time now is 05:09 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World