Improve your Access Applications in Minutes

Posted: Oct 23, 2007 | Comments: 0 | Views: 127 | Bookmark and Share

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

(ArticlesBase SC #243687)

Rate this Article
  • 1
  • 2
  • 3
  • 4
  • 5
  • 0 vote(s)
    Feedback
    RSS
    Print
    Email
    Re-Publish

    Source:  http://www.articlesbase.com/databases-articles/improve-your-access-applications-in-minutes-243687.html

    Article Tags:

    Speed

    ,

    access

    ,

    Faster

    ,

    Database

    ,

    Query

    ,

    Access Help

    ,

    Access Tips

    ,

    Access Tutorials

    ,

    Query by Example

    ,

    Qbe

    ,

    Drill Down

    ,

    Ms Accessqueries

    How to Convert Older Version of Microsoft Access Database

    Learn how to convert an older version of Microsoft Access Database into 2007 version. (07:09)

    How to Use the Database Tools Tab in Microsoft Access 2007

    Learn how to use the commands in Microsoft Access Database, Database tools tab. Explore the features of Microsoft Access database, Database tools tab. (03:57)

    Overview of Microsoft Access 2007 Database - Access Options

    Explore the features of Microsoft Access Database, Access Options found in the Office Menu. (08:27)

    How to Use the Office Menu in Microsoft Access 2007

    Learn how to use the commands in Microsoft Access Database, Office menu. Explore the features of Microsoft Access database, Office menu. (05:44)

    How to Use the External Data Tab in Microsoft Access 2007

    Learn how to use the commands in Microsoft Access Database, External data tab. Explore the features of Microsoft Access database, Create tab. (05:42)

    aminalee

    Examsoon 310-027 Testing Engine is a executeable program . This Testing Engine can help you to pass 310-027 exam easily. It covers all necessary knowledge of the 310-027 exam. With this Testing Engine, you can pass your exam at you first attempt,otherwise,you will get a full refund.

    By: aminalee l Computers > Databases l Feb 08, 2010 l Views: 4
    aminalee

    310-083 study guide resources can prove most valuable when facing the challenging 310-083 test.

    By: aminalee l Computers > Databases l Feb 08, 2010 l Views: 2
    Divya gupta

    Microsoft Excel is a spreadsheet application that allows you to carry out calculations, integrate information from poles apart applications besides justify the data. The whole story is organized as workbooks, which are saved in .xls (impact Excel 2003 and earlier versions) or .xlsx format

    By: Divya gupta l Computers > Databases l Feb 08, 2010
    spidergoose

    Sometimes also referred to as data cleaning or even data scrubbing, this cleansing, I suppose could also be called data correction. The basic idea is to weed out all the errors, imperfections or inaccuracies that may be present in your business data systems.

    By: spidergoose l Computers > Databases l Feb 06, 2010 l Views: 33
    Rainco

    Microsoft has been investigating user complaints related to the battery life of laptops running Windows 7, a problem that's apparently been drifting around since the widespread beta version was released into the wild. While there don't seem to be exact figures for the number of users affected, the issue does seem to occur for those users upgrading their laptops to Windows 7 from either Windows Vista or Windows XP.

    By: Rainco l Computers > Databases l Feb 04, 2010 l Views: 1

    We would use an MS Access subform for displaying and entering multiple items of information. The multiple items would relate to a particular record.

    By: Paul Barnett l Computers > Databases l Feb 03, 2010 l Views: 2

    As a blogger or a webmaster you will find SetCronJob to be a very useful service for you. This helps website owners to handle their cronjobs at one place.

    By: Shristy Chandran l Computers > Databases l Feb 03, 2010 l Views: 5

    Micro secure digital cards are well known for their surprisingly low size and increased performance over their standard secure digital counterparts. You can best 1gb micro sd card at an online store easily.

    By: torresward l Computers > Databases l Feb 03, 2010 l Views: 4

    This 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.

    By: Jon Watson l Business > Management l Jan 11, 2008 l Views: 66

    In 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

    By: Jon Watson l Business > Management l Dec 26, 2007 l Views: 1,419

    Color 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.

    By: Jon Watson l Business > Management l Dec 18, 2007 l Views: 102

    There 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.

    By: Jon Watson l Business > Management l Dec 12, 2007 l Views: 5

    Database 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.

    By: Jon Watson l Technology l Nov 12, 2007 l Views: 853

    Many 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.

    By: Jon Watson l Technology l Nov 02, 2007 l Views: 44

    When 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.

    By: Jon Watson l Technology l Oct 26, 2007 l Views: 145

    At 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.

    By: Jon Watson l Technology l Oct 25, 2007 l Views: 387

    Add new Comment

     
    * Required fields
    Author Box
    Articles Categories
    All Categories
    0