<

Change the Access Database Window Background

Published on
17,451 Points
10,651 Views
8 Endorsements
Last Modified:
Approved
I have seen a lot of questions from people around the internet about changing the ugly background of the Microsoft Access database window. : )

I’m going to explain a technique for changing the appearance of the background of a database- with almost no code at all!

The only code that will be added will be an open form command.

•I should clarify that this procedure will not literally change the Access background. To do that you would need to use an API.

Two API based solutions are:
http://www.mvps.org/access/api/api0035.htm
http://www.lebans.com/changemdibackground.htm

This is a technique that provides a good and simple work-around to a complex problem that produces almost the same result with nearly no code. I will let you be the judge of how it stacks up to an API approach.

The challenge to this is going to be grasping the concept.   The technique is for lack of a better term “layering” the forms. The best way to think of this is it is a splash screen that does not popup and does not close.  Another way to think of this technique is "framing a picture with a mat".

Now on to the steps:

- Create a new form.
- Set your desired background picture or choose a Detail back color.
- Save your new form.

Now set a few more settings in the form’s properties to make it appear correctly. In the form's properties set:
- Pop Up = No  (required)
- Record Selectors = No
- Navigation Buttons = No
- Scroll Bars = No

Now we have to set a few options. Go into the Access Options. Click on the tab/option “Current Database” on the left side of the menu. In this section choose your “background” form’s name in the “Display Form” drop box.

Next while still in the “Current Database” options find where it says “Document Window Options” make sure the radio button next to “Tabbed Documents” is selected.  Also un-check the box next to “Display Document Tabs”.  One last option needs to be set so that this looks the way it should. In the same current database options section un-check the “Display Navigation Pane” check box.

•      Note: when you close out of the access options a popup message saying to close your database so the changes can take effect will appear. (Just click ok)

•      Note: un-checking the “Display Navigation Pane” hides the navigation pane. The way to un-hide the navigation pane after you have set it to not show is hold the shift key while opening your database. So close your database >>press and hold the shift key >> while holding the shift key double click on your database and once it is open let go of the shift key.

At this point if you close and open your database you will see that your new form is the new background.

If you are building this background for an existing database go into each of the existing forms and make sure they are set to POP UP = yes. (*note it is always a good idea to backup your database first before making changes)

•      The only form that should not be set to popup is your background form. If you have one maximize it is ok but you will not see your fancy new background that you worked so hard for : )

If you are creating a new database and this is the first form you are making for it, keep in mind that this background form should be the only form that is set not to popup.  All of your other forms should be set to POP UP = yes.

Now the code that is needed:

Now that you have your background form opening when your database starts we need to put some code in to open the first form you want your user to be able to interact with.  The code needs to be put in the onLoad event or the onOpen event of your “background” form:

DoCmd.OpenForm "FirstFormName"

Open in new window


There you go… that’s it. I will tell you the way to make this really slick is to add a custom ribbon to your database.

If you don’t want a custom ribbon and would like to just hide the access ribbon put this code where you have the docmd.openform command
                       
DoCmd.ShowToolbar “Ribbon”, acToolBarNo 

Open in new window

   
 
For you advanced users who have multiple custom ribbons  - the approach would be to not have a ribbon specified in each form's "ribbon name" property. Instead in the onload event of a form tell it to change the ribbon of the background form.

Forms![frmBackground].RibbonName = "RibbonName"

Open in new window


While changing the background form's ribbon with the above code you can also change the background form's color or picture.

Forms![frmBackground].Detail.BackColor= vbblack
Forms![frmBackground].Picture = "c:\pic.jpg"

Open in new window


•    OK that’s it : ) For anyone not following take a look at my attached sample database for an example. I hope you enjoyed reading this and if you liked this article and or learned something please comment and mark this article as helpful :)  
 

 
 Background.accdb
8
Comment
Author:conagraman
0 Comments

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Join & Write a Comment

In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month