Archive for the ‘Access’ Category
Microsoft’s free Runtime for Access 2013 is now available for download from http://www.microsoft.com/en-us/download/details.aspx?id=39358.
The Runtime allows you to run Access applications without having to purchase and install Access.
Judging by many on-line discussions that I have read in the past few months, Access 2013 includes significant enhancements, especially related to Cloud based applications.
Congratulations are definitely in order for the core authoring team, Teresa Hennig, Ben Clothier, George Hepworth, Doug Yudovich, and to the technical editors and contributors, Glen Kruger, Jack Leach, Jerry Dennison, Leo (theDBguy™), Patrick Wood, Peter Doering , Tom van Stiphout, Scott Barker.
Guest Blogger Jack Leach is a colleague of mine at UtterAccess where his pet project is the Access Wiki. Recently, in a mailing list that we both subscribe to, Jack posted his experience in building an Access application for his business. You can find his website at http://www.dymeng.com and his blog at http://dymeng.com/blog. Jack has graciously given his permission to OTM to publish his success story.
I’ve used Access to create a shop management software for my manufacturing business. Besides the average FE type stuff: customers, orders, purchasing, quickbooks integration, the software also handles all the backend stuff: visual scheduling, what-if scenarios, integrated quality control, everything right down to tooling tracking (of which there’s thousands). Min/Max for both customer pull-supply as well as shop supply, so on and so forth. The whole nine yards.
Even more so, I was able to integrate basic CAM (Computer Aided Machining – like CAD that outputs machine tool code for producing the parts) into the routing structure for the components we make. AutoCAD automation for reading customer drawings and auto-generating tolerance sets for quality reporting, etc.
The very first piece of the application – my first Access project – saved the company an estimated $20k/year by providing different machine code formats for different machine tool platforms.
We work with medical, military, aerospace and other demanding industries, which has all been fully supported by this for quite a few years.
Recently, a colleague distributed some rather important health and well-being statistics, illustrating the data with an exploded 3D Graph. Unfortunately, while 3D graphs are more pleasing to the eye than their flat cousins; the perspective necessary to create the 3D illusion, distorts the values being plotted.
Here’s an example using simple arbitrary data. First the exploded version:
Notice how, in the 3D version, the Cons wedge appears smaller than the Pros wedge, even though the two wedges represent exactly the same value (46%). In the flat version, on the other hand, the Pros and Cons wedges appear to have exactly the same size.
Is it the Exploded view that creates this illusion? Consider the following unexploded views. The illusion persists.
An unscrupulous presenter could easily use this illusion to distort the facts and unfairly influence his/her audience. (Remember the adage: “Figures don’t lie; liars figure”?) Think about a political race, for example. Depending on which position the presenter wants to improve the apparent advantage of, all he or she has to do is rotate the 3D chart accordingly to immediately improve the apparent advantage of the favoured position:
The Pros Have It!
The Cons Have It!
Of course, these examples include data labels to help the viewer’s interpretation. Omitting the labels can only make the dishonest presenter’s self-appointed task of deception easier.
So the next time you have to create a graph, think carefully about purpose of graphs and avoid the inevitable optical illusions inherent in 3D charts.
Here are some useful links that I have recently come across on the Web. The list is weighted in favour of Excel only because, at the moment, I am doing mostly Excel training.
A help guide to working with the Fluent User Interface (Ribbon) first introduced in Office 2007 and enhanced in Office 2010, replacing traditional menus and toolbars
BLOGS AND PEER SUPPORT SITES
A blog focusing on tips and how to techniques for getting the most out of Microsoft Office Applications
User peer support forum primarily focused on Microsoft Access but with an active Excel forum as well
Bill Jelen’s (Mr. Excel) site includes peer support forum and many pages of Excel help and tips from Mr. Excel himself
YouTube gateway to the ExcelisFun channel –hundreds of well documented videos illustrating how to do just about anything in Excel.
An excellent collection of Excel related links
Clever data validation example
Color Palette and the 56 Excel ColorIndex Colors:
Create an Excel UserForm
Excel Add-ins Directory:
Analytics and Visualization
Excel for Developers
Excel VBA – Reference Guide
Index of /Excel:
The Spreadsheet Page:
Excel Add-ins Directory
Use Excel spin boxes to help with financial modeling:
VBA for Microsoft Office Excel 2007
Yahoo Groups MS_Excel
Yahoo Groups Excel VBA:training.
Jack Leach who has been very busy for some time tweaking the Access Wiki has just posted this news item at UtterAccess, the first of an announcement series for Wiki content. In this announcement, Jack feature these articles:
- Base Ten to Base Letter
- HttpRequest_Class and Access and the web HTML Object Library
If you are interested in enhancing your Access knowledge check out Jack’s post for links to these article. You might even want to browse the entire Wiki Table of Contents.
This article demonstrates how to create a co-ordinated set of Access forms that could be used, among other things, as a Dashboard or Launching Pad in an Access User Interface. Form content depends on the needs of the application. The forms in the demonstration application are just simple examples to illustrate what can be done. They are there just to show what the code behind the scenes does.
The concept is similar to Frames in HTML Documents.
There are six forms in the demonstration application:
The other forms take turns populating either frmShell’s subform control second level subforms. The form name indicates each form’s relative position in the overall hierarchy.
|The content forms can be loaded as individual standalone forms.|
frmContent and its two child forms
frmShell_ContentTabs with Mouse pointing at the Child Tab
frmShell populated with frmShell_ContentTabs (populated with frmShell_ContentA)
frmShell_ContentA_1 and frmShell_ContentA_2 populate two subform controls on frmChild when that form is the main child form of frmShell
frmShell_ContentTabs is an alternate child form to frmShell. This form uses a tabbed style of interface to swap its subform content in and out.
frmShell_ContentWelcome populates frmShell with startup information.
Behind the Scenes – the Code
The main code that makes it all work is quite simple as long as you get the notation right. Content screens are swapped by assigning a form to the SourceObject property of the desired subform control.
For example, if a form has a subform control named fsbMainWindow, then a content form (for example, frmContent1) can be assigned to the control with this statement:
me!fsbMainWindow.SourceObject = “frmContent1”
Once the content form has been assigned to the subform control you can then refer to any controls or public properties in one of two ways:
me!fsbMainWindow.Form.[name of property or control]
or by creating a form object and assigning the subform object to the form object. Of course you have to declare a from object.
Dim frm as Form
then you can use the object by assigning the subform control to it.
Set frm = Me!fsbmMainWindow.Form
You can then use the object to refer to the content form and its controls and properties.
frm.txtDate = Now()
assigned the current date and time to a textbox named txtDate on the content form.
If there are several ‘windows’ on the form, then the object approach makes it easier to keep track of which window content you are referring to.
A subform can talk back to the form that contains it using its own parent property.
me.parent.CurrentChild = me.name
is a trivial example. Of course you would have to declare a public variable or property, CurrentChild in the parent form.
It is possible to nest up to seven levels (Access XP and later, three in Access 2000) of subforms on a form. The notation can be confusing because you have to have the bang operator (!) in all the right places. For example,
refers to the subform one level down. If you want to refer to a subform nested on the form one level down, the notation is
Me!fsbMainWindow.Form![name of subform control].Form
For a general reference on referring to sub forms and sub reports see this page on The Access Web.
If you need to set the focus to a control on a sub form, first set focus to the sub form control and then set focus to the control you want to have focus.
General Development Guidelines
If you will be swapping several forms in and out of the same subform control, it helps to first create a simple empty form that is set up with the appearance that you would like all of the forms that you will use in that particular subform. Use that form as a template for each of the others.
A naming convention also helps keep the various forms straight in you mind. For example begin the name of each related form with frm followed by a generic name for the group of forms. For each sub form, append an underscore followed by a meaningful name for the particular sub form. Using this approach, all of the related forms are listed together in the database window or navigation pane depending on your version of Access.
Using a shell form to ‘house’ the main forms of a user interface makes it easier to create and maintain a consistent ‘look’ and feel for the application.
The demonsration file can be downloaded from:
Delete queries delete all records from the specified table that meet criteria specified in the query.
Scenario: The table of country names that you have inherited contains some invalid names. You have already updated the records that used to point to these names so they now point to the correct form of the relevant country name. Now you want to remove the invalid names from the table.
With just a few entries, you could just open the table and delete the bad records. However, if you have many records to delete, a delete query can take care of all of them at once.
IMPORTANT: Before running a query that will modify your data, it is very important to first back up the data. You can do this either by copying the table’s structure and data or by backing up the entire database.
Setting up the query is quite straight forward. Use the table you want to clean up as the query’s record source and include the field that will determine whether or not a record should be deleted.
This query will delete records that contain “United States” in the Country field. All other records will be untouched.
If you include additional criteria on the rows below the first criteria, then the query will delete records that match any one of the criteria.
Viewing a query will display the selected records in the query’s datasheet view.
Running the query, on the other hand, actually deletes the selected records.
Note also that double-clicking a query icon in the database window or Navigation Pane, runs the query. If you are not absolutely sure you should be running a query, open it in design view and view it in datasheet view.
Sample files for Action Queries (Access 2000 and 2007/2010 format) can be downloaded from:
Update queries are the means to modify record data in one or more fields in all the records that match the criteria you specify. For this article, I have modified the sample data so that it reflects an all too possible scenario.
Scenario: You have inherited a customer database where customer data was stored in a single table. You have normalized the table. When you created and populated the Countries table, you didn’t recognize that the country data inserted into the original table was inconsistent. Some country names were mis-spelled (Mxecio, United Staes, for example) and several forms of the name were used for others (US, USA, and United States, for example). The problem came to light with the Regional Manager for Mexico reported that one of more of his customers appeared to be missing when he search for customers in Mexico.
Solution: When you looked at the Countries table you recognized that the data had spelling variations for some countries. You have produced a new table with the correct spelling for each country’s name and there are no variations in the form of the name.
Now you want to clean up the data so that your normalized customers table will refer only to the new Countries table. You can’t simply delete the bad spellings because some of the records in your new customers table probably refer to these misspelled country name records.
The solution requires first identifying which customer records refer to bad country name and then updating those records so that they refer to the correct spelling. The query results at the right is a comparative list showing the current list of country names together with a list of only valid names. In design view the query looks like this:
Notice that the tables are joined by the country names, not by keys. An empty cell in the valid country column indicates that the name in the cell in the left column is invalid. This query gives us the information we need to know which records to update and what CountryID should be used for the update.
In the Customers table, these changes need to be made to the CountryID field
- Mxeico 13 update to 12
- United Staes 21 update to 24
- United States 22 update to 24
- US 23 update to 24
Because each of these updates has different criteria, four update queries will be required. (As you will see, you use a single query and simply modify the criteria after each update.) After we execute these updates, the customer table will correctly refer to Mexico and USA, respectively in the Countries table. Then the invalid names can be deleted from the Countries table.
A simple unmatched records query will help identify just the customer records that need attention. It is similar to the last query but this is what the results will look like:
The Is Null Criteria limits the output to just the unmatched records:
Now we are ready to create the actual update queries. This query will need the valid country id with which we want to update the affected Customer records:
This query includes the Company name field simply for “comfort.” The table requiring update is joined in this case to its related Countries table so that we can restrict the record by the actual. Before running an action query it is usually a good idea to view the record selection you have specified. However, the datasheet view of an update query only shows you the field to be updated with its current value. To see more about the records that will be updated, you can temporarily convert the query to a select query and the view its datasheet.
Again you are only seeing the current data but you can verify that you have in fact set the criteria correctly. Now all that remains for the update is to convert the query back to its update form and then run it.
After you run the query for the first incorrect country name, you can change the query to the next misspelling, verify and run it. You simply repeat this process until you have updated the Country Id for all of the misspelled country names, one at a time.
It’s a good idea at this point to create a query to verify that the invalid country names are no longer referenced from the Customers table.
Remember: never run any data manipulation queries before backup up the affected tables and or the entire database.
Final cleanup involves deleting the records with the bad spelling. The next article in this series will discuss Delete Queries