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
- Broadband Wireless Internet Access
- High Speed Internet Service Comes to Rural Areas through Satellite Technology
- High Speed Internet Technology From Comcast Spells Success
- Internet Access Types
- Access Internet At A Fast Speed
- Speed Up Your Web Browsing Experience - Web Accelerator




Data Warehouse And Its Applications In Agriculture Based On Rajasthan State
By: felix deepak minj | 03/07/2009Analytical exploration of vast amount of agricultural data can best be support by appropriate application of Data Warehousing and OLAP technologies. A Data Warehouse provides efficient and reliable structure of storage for vast amount data while OLAP techniques provide mechanisms for analysis of this data.
Database Driven Telemetric Monitors Promise Bright Future for Manufacturing
By: Tom Gruich | 02/07/2009Database Driven Telemetric Monitors can introduce manufacturing companies to a new kind of innovation that incorporates current off-the-shelf software components that control GPS, RFID, telemetry systems and a host of additional database driven products that range from classical accounting software to new XML-sensor transportable software.
Database Software Simplifies Integration of RFID into Business Activities
By: Tom Gruich | 02/07/2009The scripted technology employed by Adaptcode Scenarios of adaptive mapping applications enables Customers to easily integrate systems powered by wireless technologies into their business processes.
EDB Corruption Due to Improper Termination of Information Store Service
By: Christa Atwater | 25/06/2009The common reasons of EDB (Exchange DataBase) file corruption are improper system shutdown due to operating system malfunction, system crash, and hardware failure or power outage. If Exchange Server’s Information Store Service gets terminated inappropriately, the EDB file may get corrupt and become inaccessible. This behavior makes all your critical data inaccessible and result as serious data loss. You need to go for EDB Recovery tools to solve this issue. When you try to start Micro
Database-driven Software for the Small Business Owner
By: Tom Gruich | 25/06/2009Regardless of what you sell or the services that you provide, there are dozens, if not hundreds of things that you must keep track of on a daily basis. You can either spend your time pulling your hair out or do what we’ve done with our businesses.
Find Out More About How To Spot Better Database Developers UK
By: Steve Laye | 24/06/2009There are lots of options available for you to consider at the time of finding a database developer. But, you have to wear belt and braces while conducting your search otherwise you will never be able to get the best results.
Runescape
By: ssbase | 21/06/2009http://www.powerleveling-runescape.net
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.
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.
Ms Access Tip: Keeping Up With User Activity
By: Jon Watson | 25/10/2007 | TechnologyAt times you will find it very handy to know what a user was doing in your application at a specific time. This is especially useful with multi-user database applications for debugging or security reasons. With this tool implemented in your applications you will be able to see what event happened and at what time.