Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Form Background with Gradient Color

Introduction

Form background pictures are not only used for giving the Form a different look, but also for other useful purposes as well.

For example, if the user is keying in data from a pre-printed Document like a Telephone Bill or Electricity Bill etc.; it is a good idea to scan an image of this Document and use it as the Data Entry Form's background picture. The Data Fields can be positioned in appropriate locations on the image matching the physical Document so that it will be easier for the user to find information on the Document and key in exactly the same locations on the Form.

Microsoft Access Form Wizard has several images to use as a background picture, but I didn't find the one that I need; the one with a gradient background. So, I thought I would make one of my own and use it.


Creating a Sample Image

The steps that I have taken are given below to create the image for the Form Background picture.

  1. Opened a new Microsoft Word Document and went through the following steps to create a Gradient Bit Map Image:
  2. Selected Format - - >Background - - > Fill Effects.
  3. Under Colors, options selected One Color.
  4. Clicked on the Color 1 drop-down control and selected a light color.
  5. Used the Darker/Lighter slider control to adjust the color tone.
  6. Selected the Horizontal Radio Button under Shading Styles.
  7. Clicked on one of the Style Variants.
  8. Clicked OK to apply the selected shade as the Background of the Word Document.
  9. Maximized the Word Document Window.
  10. Push the Prt Scrn key (at the top row right side). The full-screen image is now captured and copied to Clipboard.
  11. Opened MS-Paint Program. You can find this in Start - - > Programs - - > Accessories.
  12. Displayed the Toolbox (View - ->Toolbox or press Ctrl+T).
  13. Selected the Select Tool (the one at the top right with a rectangle picture).
  14. Drawn a rectangle from the left top corner of the gradient image area to the right bottom corner to select the image large enough for my Form's width and height. If you find the width is not enough to cover your form then change the Page Orientation of the Word Document into Landscape before capturing it in MS Paint.
  15. Use Ctrl+C to copy the selected area into Clipboard.
  16. Clicked outside the selected area to deselect the earlier selection.
  17. Selected Clear Image from Image Menu (Ctrl+Shift+N) to clear the Canvas. Inspected the right Scroll Bar to check whether it is positioned at the top or not. It was positioned slightly down so I dragged it up to the top. Similarly adjusted the Scroll bar at the bottom to the position at the left end.
  18. Pressed Ctrl+V to paste the copied image from the Clipboard.
  19. Clicked outside the pasted image to de-select it.
  20. Dragged the Sizing control at the bottom of the Canvas up and stopped at the edge of the pasted image to eliminate the white area of the canvas.
  21. Similarly adjusted the right side of the image.
  22. Selected Save from File Menu to save the image at a convenient location with a name.

If you were with me so far then we will enter into the next stage of implementing the gradient image as a background picture. But, there are some limitations to using images like this one as a background picture, but we can overcome this with a little trick. If you are thinking about the increase in the size of the database then you are in the right direction. If you are considering the idea of saving the image in .jpeg or .GIF format; then you are far ahead of me. Saving the image in .GIF format in MS Paint will not give you a good quality image. If you have software like Adobe Photoshop then you can make better quality .GIF images.

We will do another trick to use the .bmp image itself to maintain the background image quality without affecting the database size.

But, first, let us see how to apply the gradient image as the Form's Background picture.

Inserting the Image on the Form Background

Before opening your database if you would like to check the present size of your database you may open Windows Explorer, check and note down the current size of the database. I suggest you better Compact the Database before you take its file size. You may check it again after the background picture is added to a Form to find the difference.

  1. Open your Database and open a Form in Design View or create a new one.
  2. Display the Property Sheet of the Form (View - -> Properties).
  3. Find the Picture Property and click on it.
  4. Click on the build button (. . .) at the right side of the Property Sheet and click on it to browse to the location of the image you have saved and select the image.
  5. The next four Properties are used for formatting and displaying the Background Picture.
  • Picture Type
  • Picture Size Mode
  • Picture Alignment
  • Picture Tiling

Linked or Embedded Image Methods

The Picture Type Property has two choices Embedded or Linked to select from and the default value is embedded. The embedded option is provided for invoking the default Image Editor Program from within MS-Access by double-clicking on the image and making changes to the image if needed. To facilitate this; the necessary image editor program invocation information is also stored along with the image in the database, resulting in a substantial increase of the database size for each image you add this way on your Form or Report. But, the background image inserted this way cannot be edited by double-clicking on the background as we do on the inserted image as an OLE object, on the Form.

A better choice is the Linked option which will keep the image outside and the database size is not affected. In either case, the image should go along with your database in the same location as the image wherever you take your database.

The Picture Size Mode has three options Clip (default) displays the picture in actual size wherever you position it by setting one of the Picture Alignment property Values (Top Left, Top Right, Bottom Right, Bottom Left, Center, and Form Center). The Center option will position the image vertically and horizontally centered on the Form and the Form Center option will position the image vertically centered on the left side.

The Stretch/Zoom/Tile Picture Methods

The Stretch Picture Size Mode option will stretch the image to fit the dimension of the Form and result in distortion of the image if it is a picture of something.

The Zoom Picture Size Mode option will attempt to maintain the right proportions of the image when stretched to match the dimensions of the Form. But both the Stretch and Zoom options will show stretch marks when the Form is restored to its original size. This is very much evident when a .jpeg or .GIF image is used.

The One Pixel Width Image

We can modify our earlier .bmp file to a one-pixel width image and Tile it across the Form that will give a good quality gradient picture effect and the image size also will be small.

  1. Open the earlier saved .bmp image in MS Paint Program.
  2. Select Attributes. . . from Image Menu.
  3. Change the Width value to 1 and let the Height value remain without change.
  4. Check the Units selected is Pixels.
  5. Save the image with a different name.
  6. Change the name of the background image to the new image in the Picture property of the Form.

    Caution: Do not attempt to use the Picture Size Mode property options Stretch or Zoom; MS-Access will hang up.

  7. Set the Picture Tiling Property Value to Yes and save the Form.
  8. Open the Form in Normal View and enjoy your creation.
Share:

13 comments:

  1. I spent my Monday evening in geeky delight playing with these ideas.

    Very nice example of efficient use of the tools at hand!

    Two suggestions:
    1) Choose one of the dark-light-dark or light-dark-light options in Word. This way, if you make good choices on sizing and selecting, you can get seamless tiling for big forms.
    2) Use Paint attributes to downsize the canvas before copying the gradient image -- it will grow as needed, and this approach is much less aggravating than trying to manipulate sizing.

    PE in CT

    ReplyDelete
  2. I find it easier to create the same effect by photoshopping the image before adding it to the form background. I was looking for info about using an animated gif in a form background. Is this possibile?

    ReplyDelete
  3. I lately found your blog/website and have really loved reading this and some of your other posts. I believed I would dive out from the shadows and leave my very first comment. I'm not certain what to say other than I have enjoyed reading through and will continue to visit as frequently as I can.

    ReplyDelete
  4. Conveyancing Solicitors...

    [...]while the sites we link to below are completely unrelated to ours, we think they are worth a read, so have a look[...]...

    ReplyDelete
  5. Download Movies...

    [...]below you'll find the link to some sites that we think you should visit[...]...

    ReplyDelete
  6. Full Movie Downloads...

    [...]here are some links to sites that we link to because we think they are worth visiting[...]...

    ReplyDelete
  7. 1.) Extra Reading...

    2.) [...]this site is off topic but I recommend taking a quick look at it[...]...

    ReplyDelete
  8. Evil eye pendant...

    I saw this site and linked to it! Toataly recomended!...

    ReplyDelete
  9. 1.) What do you think...

    2.) [...]it would be cool if you took a look at this site. It has some good information on it[......]...

    ReplyDelete
  10. Blogging Internet...

    [...]we like to honor other sites on the web, even if they aren't related to us, by linking to them. Below are some sites worth checking out[...]...

    ReplyDelete
  11. OpenOffice Download...

    [...]listed below are several links to internet pages I always link to because we believe they really are worthy of browsing[...]...

    ReplyDelete
  12. Flash Website Builder It's An Incredible Posting Congratulations...

    Terrific story, reckoned I wish to track-back on it. FYI did you heard the news about the tsunami now has a lot more difficulties too :)...

    ReplyDelete
  13. nissan juke review...

    Awesome post, I've linked back to your blog here http://www.vwsuv.net/sites-we-like/ return the favor if you can, thanks!...

    ReplyDelete

Comments subject to moderation before publishing.

PRESENTATION: ACCESS USER GROUPS (EUROPE)

Translate

PageRank

Post Feed


Search

Popular Posts

Blog Archive

Powered by Blogger.

Labels

Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Objects Menus and Toolbars Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Combo Boxes Dictionary Object ListView Control Query VBA msaccessQuery Calculation Event Graph Charts ImageList Control List Boxes TreeView Control Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Key Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Report msaccess menus msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances ImageList Item Macros Menus Nodes RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference Utility WScript Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Desktop Shortcuts Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers Import Labels List Logo Macro Mail Merge Main Form Memo Message Box Monitoring Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code