Archive for ‘MS Access Samples’

December 9th, 2012

MS Access Sample- Export Data to Excel and/or Word

Over the years, I have answered numerous questions regarding how to export a records, or records to either MS Excel or MS Word. I already have 2 posts on the subject:

but thought a concrete example would help illustrate things even further.

Here are a few screenshots of the sample.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now in this sample I am covering Excel and Word automation, not built-in commands, such as:

  • DoCmd.TransferSpreadsheet
  • DoCmd.TransferText
  • DoCmd.OutputTo
  • DoCmd.RunCommand acCmdExportRTF

These are well documented, and plenty of examples can be found online.  Instead, I concentrate on demonstrating a few possible ways to export using late binding and word and excel automation, permitting much more control on the final product (font, colors, layout, page orientation and so much more) and no need for any external reference libraries.

Note: for this sample to work, all the supporting files (excel and word) must be in the same folder as the database itself (although this very easy to change in the VBA code provided).

Fill In Excel Or Word Access Demo

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
June 9th, 2012

MS Access – Sliding/Shutter Subform Example

I was looking for a simple way to reproduce a web style expandable sidebar (accordian subform, expandable subform, sliding subform, shutter subform, or whatever name you'd like to use to describe it in MS Access), instead of merely making a subform visible/invisible. The attached file, does exactly that and with a single change to a constant variable you can control the speed of the shutter/slidder.

This is a very crude example to illustrate the principle.  You can use any subform you like, within any form you'd like.  There are no requirements to make this work and all the code is native MS Acces code, no external references, or ActiveX Controls.  The button used to expand and retract the subform can also be changed as you see fit, it is just a question of placing the brief code behind whatever button you select to use in your design.

 

 

 

 

 

 

Just another nifty method to add a little wow factor to a form.

Sliding/Shutter Subform Example Download

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 23rd, 2010

MS Access Sample – Clocks and Timers

This database demonstrates how to insert a clock in your forms to display the current time as well as a demonstration of how to create a timer used to determine the amount of time which a form has been open for.

Download the sample database: MS Access Clocks and Timers Sample Database

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 22nd, 2010

MS Access Sample – Working with Dates

This database demonstrates some of the most common ways to work with dates. It demonstrates how to extract only a part of a date (year, month or day), how to display a date in different formats (ISO, American,…), how to determine the number of days, weeks between 2 dates, etc.

Download the sample database: MS Access Working with Dates Sample Database

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 20th, 2010

MS Access Sample – Working with Images

This database example show the proper way to work with images within a database (which is not to embed them into the database).

Download the sample database: MS Access Images Sample Database

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 19th, 2010

MS Access Sample – Change Password

If you are using user-level security (ULS), the following is a simple demonstration of a form that can be added to any database to permit the user the ability to change their password. Useful when you create an mde or disable the standard toolbars for increased security but still want to give the user the ability to rotate their own password.

Download the sample database: User-Level Security Change of Password Form Demonstration

Special Note & Warning
Be very careful using this sample.  If you run it on a database which does not have a designated mdw security database assigned, it will alter the system.mdw, thus affecting ALL your databases!  It is only meant to be run on secured databases using ULS security.  Any other applications can have disastrous results on your databases.  I mention this because I recently was e-mail by someone who made this mistake.  Below is the solution to fix such a mistake:

So if I understand the situation properly, you ran the chgPwd.mdb on your computer, in a db, or on its own in a db that wasn’t already secured?  I would assume that by doing so you inadvertantly applied a password against your system mdw database.  So in fact you secured the master system.mdw database, thus imposing a password against all databases running on your computer.  The fix, you’d need to either reinstall Access, or copy over a system.mdw from another clean PC over to your.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 18th, 2010

MS Access Sample – Data Transfer

This database provides a single form which permits the user to either import or export data to/from the database from a selected source (spreadsheet).

Download the sample database: MS Access Data Transfer Sample Database

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 17th, 2010

MS Access Sample – Colors

This is a very simple database which provides the user a form which permits them to convert color values between OLE Color values, RGB values and HEX values.

Download the sample database: MS Database Color Converter Sample Database

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 16th, 2010

MS Access Sample – Common Issues

This database demonstrates common programming concepts, such as: basing one combo box’s list on anothers value, changing a control’s background color, changing a form’s background color. This sample database will be updated as I have time to add to it.

Download the sample database: Common MS Access Issues Sample Database

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print