Jon Watson founded BioMation Systems after 26 years of consulting with Fortune 500 companies to bring fast and affordable process improvement to smaller companies.
Database Tips and Techniques
Databases are very powerful tools used to find, sort, reformat, manage, send and do all kinds of other things with data on your computer. The more data you have the more you need a database to access it quickly, but that makes the data harder to find. So, we built a tool that lets a user ¡§drill down¡¨ to data very quickly in a form by just clicking on a field that has the type of data that he wants to find. Lets say you have a customer database with thousands of records from customers all over the country and you need to find every one born in June in Georgia with the last name of Smith to do a promotion. Quick how do you find that data? With this tool you can find it with three clicks of your mouse! Take this technology and make it yours to create very powerful forms for your user applications.
Create a Drill Down Form
Create a form that lets you drill down to the data you want to see by just clicking on a field in the form. This example is built for/with Access 2000. It requires that you have a moderate level of experience with Access 2000 and creating Access Applications.
The Drill Down form allows you to quickly sort down to information that you want to see. In this picture example you can click on a county name and it will sort the table for that county. If you click on Douglass in the county column the form will filter and sort and just show you every client that lives in Douglass county. If you subsequently double click on Douglass the form will un-apply the filter and reshow all counties. It is a really fast way to drill down to specific data and adds a powerful form to any application that your users will love to use.
You can set up as many or as few columns as you wish to be active for sorting and filtering. In this example I have set up the Firstname, City, County and DOB columns to drill down as you select. The filter is also cumulative, so if you select more than one item for filtering then you continue to drill down until you get to one record.
The column headings also are used to perform an Ascending sort based on the data in their respective columns. So, by clicking on the City label, the data would sort alphabetically on the city names.
Try it and see. You and your users will find it a very powerful addition to any application.
Create a Module and name it DDFMod then key in or copy these lines into the module.
Option Compare Database Public DDFFname As String Public DDFLname As String Public DDFSort As String Public DDFCity As String Public DDFStreet As String Public DDFState As String Public DDFCounty As String Public DDFDate As String
Public Function GetDDFSort() As String GetDDFSort = DDFSort End Function
Public Function GetDDFCity() As String GetDDFCity = DDFCity End Function
Public Function GetDDFStreet() As String GetDDFStreet = DDFStreet End Function
Public Function GetDDFCounty() As String GetDDFCounty = DDFCounty End Function
Public Function GetDDFState() As String GetDDFState = DDFState End Function
Public Function GetDDFdate() As String GetDDFdate = DDFDate End Function
Public Function GetDDFFname() As String GetDDFFname = DDFFname End Function
Public Function GetDDFLname() As String GetDDFLname = DDFLname End Function
Next Create a Client table and Name the new table client
Next Create a Query (you can do this by copying the following sql into the query designer in Access.
Create a new query and view it in SQL View. Then cut and paste the following sql into the form. Then save the query as DDFExample.
You can type following SQL into the SQL view in Access or better yet cut and paste it. If you then switch back to design view you will see the query in the form shown above.
SELECT client.Fname, client.Lname, client.Street, client.City, client.St, client.Zip, client.county, client.Phone, client.DoB, IIf(GetDDFFname()="ALL","ALL",[fname]) AS DDFFname, IIf(GetDDFLname()="ALL","ALL",[Lname]) AS DDFLname, IIf(GetDDFCity()="ALL","ALL",[City]) AS DDFCity, IIf(GetDDFdate()="ALL","ALL",Str([DOB])) AS DDFDate, IIf(GetDDFState()="ALL","ALL",[St]) AS DDFState, IIf(GetDDFCounty()="ALL","ALL",[County]) AS DDFCounty, IIf(getddfsort()="city",[city],IIf(getddfsort()="county",[county],[fname])) AS sort FROM client WHERE (((IIf(GetDDFFname()="ALL","ALL",[fname]))=GetDDFFname()) AND ((IIf(GetDDFLname()="ALL","ALL",[Lname]))=GetDDFLname()) AND ((IIf(GetDDFCity()="ALL","ALL",[City]))=GetDDFCity()) AND ((IIf(GetDDFdate()="ALL","ALL",Str([DOB])))=GetDDFDate()) AND ((IIf(GetDDFState()="ALL","ALL",[St]))=GetDDFState()) AND ((IIf(GetDDFCounty()="ALL","ALL",[County]))=GetDDFCounty())) ORDER BY IIf(getddfsort()="city",[city],IIf(getddfsort()="county",[county],[fname]));
Next Create a Form
Use the DDFExample Query you just defined as the data source for this form.
In Design View Lay your form out as below.
The following are the label names as shown on the Other Tab on the properties form. from left to right on the above form.
namelabel, Lnamelabel, Streetlabel, Citylabel, Countylabel, Doblabel. phonelabel
Name your form and save it.
Form Code
Create the following VB code for each the respective controls on the form. Again you can cut and paste the next section right into your form in design mode.
Option Compare Database
Private Sub county_click() DDFCounty = county DoCmd.Requery End Sub
Private Sub county_dblclick(Cancel As Integer) DDFCounty = "All" DoCmd.Requery End Sub
Private Sub clientname_click() DDFFname = ClientName DoCmd.Requery End Sub
Private Sub clientname_dblclick(Cancel As Integer) DDFFname = "ALL" DoCmd.Requery End Sub
Private Sub City_click() DDFCity = City DoCmd.Requery End Sub
Private Sub City_dblclick(Cancel As Integer) DDFCity = "ALL" DoCmd.Requery End Sub
Private Sub dob_click() DDFDate = Str(DoB) DoCmd.Requery End Sub
Private Sub dob_dblclick(Cancel As Integer) DDFDate = "ALL" DoCmd.Requery End Sub
Private Sub Form_Open(Cancel As Integer) DDFSort = "fname" DDFFname = "ALL" DDFLname = "ALL" DDFCity = "ALL" DDFCounty = "ALL" DDFDate = "ALL" DDFState = "ALL" DoCmd.Requery End Sub
Private Sub Lname_Click() DDFLname = Lname DoCmd.Requery End Sub
Private Sub Lname_DblClick(Cancel As Integer) DDFLname = "ALL" DoCmd.Requery End Sub
Private Sub namelabel_click() DDFSort = "Fname" DoCmd.Requery End Sub
Private Sub closeqb_click() DoCmd.Close End Sub
Private Sub Citylabel_click() DDFSort = "City" DoCmd.Requery End Sub
Private Sub countylabel_click() DDFSort = "CCY" DoCmd.Requery End Sub
Private Sub ReqQB_click() DDFSort = "fname" DDFFname = "ALL" DDFLname = "ALL" DDFCity = "ALL" DDFCounty = "ALL" DDFDate = "ALL" DDFState = "ALL" DoCmd.Requery End Sub
This should do it. Seems like a lot of work for such a short form, but the more data that you have the more powerful this tool becomes. We have users sorting through more than 4000 customer demographic data records using this tool and they love it.
What could BioMation Systems do for you?
For a more detailed article including graphics see www.biomationsystems.com.
You can also download a more powerful and easy to use version of the drill down tool now. The new version eliminates a lot of the setup needed. Find it by looking for the Drill Down Designer download page at either of our sites listed below.
Thank you for your interest and I hope you find this article useful in your efforts to develop powerful applications for your users.
BioMation Systems, Inc is an Atlanta, Georgia based consulting company that develops custom database solutions that increase the efficiency of businesses around the world. BioMation's range of services can be found at www.biomationsystems.com
You can find help for Access at
http://www.accessdatabasehelp.com
http://www.accesshelpebook.com
http://www.biomationsystems.com/AccessTips.htm
Contact: jonw@biomationsystems.com
- Related Videos
- Related Articles
- Ask / Related Q&A
- What Satellite Internet Access Can Do for you
- Finding and Getting a Deal on a High Speed Internet Connection
- Improvement of High Speed Internet Access and Increase Broadband Internet Access
- Broadband Wireless Internet Access
- Enjoy high speed Internet connections with beneficial broadband deals
- High Speed Internet Service Comes to Rural Areas through Satellite Technology
- High Speed Internet Technology From Comcast Spells Success
- Internet Access Types




Know the information USB sticks
By: John Milton | 24/12/2009Now in the market there is high demand of usb sticks among its users. Seeing this the producers of usb sticks now focussing more on its reliability.
Download Jak and Daxter The Lost Frontier PSP Game
By: Sarah Brown | 23/12/2009PSP UMD discs are becoming quite expensive these days, many gamers are seeking for new alternatives to get the newest and their favorite PSP games for cheap. This article will expose on how and where you can download Jak and Daxter The Lost Frontier for less than $0.01. Jak and Daxter The Lost Frontier is already released on PSP handheld, so you can proceed to download the game instantly.
A Photography Course For All The Family
By: Dan Feildman | 23/12/2009Excellent Digital Photography Courses Introducing Free Digital Photography Guide called "How To Take Beautiful Digital Pics Made Simple". The latest tips on how to use a digital camera like a pro.
Reinforce Database Management with Remote DBA
By: Kashif Mukhtar | 23/12/2009Databases are the foundation of the digital economy. They store the information that run businesses and organize the vast amount of data that is created on a regular basis. Even though e-business infrastructures are requiring stronger database support to sustain their 24x7 operations, shrinking IT budgets are forcing companies to reduce the size of their DBA staff. With databases growing in size and complexity, the role of the already overburdened DBA is becoming increasingly difficult.
Download Full Version Movies - Downloading Movies Have Never Been Easier - Download as much and as often as you like for one fee!
By: Dimitar Mishev | 22/12/2009We as movie watchers have come a long way since the introduction of movie tapes and watching movies from our home. From beta max to the VCR tapes, we have rented and recorded thousands of movies and still do.
Download Dvd Movies Safely - If You Are Looking To Download Dvd Movies, Check Out These Tips - Amount of Content Available
By: Dimitar Mishev | 22/12/2009There are so many of us now days that are trying to find ways to save some money, and one of these ways is cutting back on movie purchases. If you are one of these then you will be happy to know that there are places that you can download DVD movies right on the Internet. And, not only can you download some great movies, you can also burn them to a disc and play them in a DVD player and your computer.
Download Movies Full Length In Your Own Home - Why Are You Wasting Time At The Video Store - Have you seen the price of DVD's lately?
By: Dimitar Mishev | 22/12/2009You are no longer stuck with the local video store on the corner, which by the way is always out of the new releases, to get your movie rentals. You can now download movies full length right onto your computer and even burn them to disc.
Download Movies Full Length In Your Own Home - Why Are You Wasting Time At The Video Store - Have you seen the price of DVD's lately?
By: Dimitar Mishev | 22/12/2009You are no longer stuck with the local video store on the corner, which by the way is always out of the new releases, to get your movie rentals. You can now download movies full length right onto your computer and even burn them to disc.
Ms Access Tip – you Have Heard ofs, Now Learn to Use Them
By: Jon Watson | 11/01/2008 | ManagementThis example demonstrates using an array and SQL statements to create the similar records. It also has a function to replace records if you want to change the amount value and update the data table. The replace function assumes that the description and date are the same and replaces every occurrence of the existing record with the latest amount value. For safekeeping the replace function makes a copy of the data table before executing.
Ms Access Tip – How to Use Variables in the Access Query Design Form
By: Jon Watson | 26/12/2007 | ManagementIn this example you are going to learn how to enter or select data in one form and open another form with more data related to the field you just selected by taking advantage of global variables in the query design form
Ms Access Tutorial - How to Use Color Coding to Enhance your Applications
By: Jon Watson | 18/12/2007 | ManagementColor coding adds value to a form as it easily directs the user's eye to critical data. This is a powerful technique that allows a user to quickly evaluate a pages of data for errors or warning information.
How to Get the Most From your Training Dollar
By: Jon Watson | 12/12/2007 | ManagementThere are so many people telling you that you can make such a huge return on your investment these days that you just can't believe any of them any longer. I know, I have received so many get rich emails that I should be earning about a billion a day now! How about investing in something that you really believe in. Yourself.
Ms Access Tip: Self Learning Combo Box
By: Jon Watson | 12/11/2007 | TechnologyDatabase data entry can be tedious at times. You can make your databases more user friendly if they have a way to select data to enter rather than typing in the same data over and over. Access provides a form control called a combo box to help with this task but it can lead to trouble.
Access Databasetip: Create a User Defined Search Field for a List Box
By: Jon Watson | 02/11/2007 | TechnologyMany times it is necessary to provide your users with an easy way to filter or search for data in large table of information. This tip will show you one quick and easy way to solve the problem by giving the user a field to enter a search string and updating the form with those fields that fit the search pattern. It's quick and easy, so give it a try. Read about how Access was a big success solving a license tracking issue in this article.
Access Database Tip: How to Multiselect in a Listbox
By: Jon Watson | 26/10/2007 | TechnologyWhen you have a list box it is handy to be able to multiselect to perform some action on multiple items in the listbox. Here is a simple set of instructions to get you started. These instructions will create a quick way to multiselect and delete rows from a table.