Frothingslosh
Premier Pale Stale Ale
- Local time
- Today, 13:05
- 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:
Using it is pretty straightforward:
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.
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
- 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.
- BGForm.accdb
- BGFormExample.accdb
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
Last edited: