FoxPop
 

www.foxpop.co.uk

 

POWERBASE TUTORIAL 6c

by Laurie Jane Kern  

Searching: Find, Filter and Groups - A lesson in 3 parts

Tutorial 6c - Groups

 

This tutorial uses the same Sample Address Book (06) as you used in tutorials 6a and 6b. If you have not already done so, please download it now.

In Tutorial 6a you learned how to use Find and to change the Find properties. You discovered that a Find has to be entered in the Find editor whenever you want to use it. In Tutorial 6b you learned how to construct a Filter. You discovered that a Filter can be as simple as a Find or more complex, using several Fields to refine your selection. You also saw that a Filter is retained in the Filter Expression Editor until you change it.

But what if you want to use several different filters over and over again and you don't want to have to enter them every time? You can't really save a Filter - so what you do is use a Group!  A Group is an expression that results in a subset of records within a Table and it is saved within the database. A Group can be restored or removed at any time and it allows you to specify a sort order in which those records are displayed. Here is a piece of good news: you can still use Find and Filter to further refine the subset of records returned by a Group!

In tutorial 6b, you may remember that you had 3 records of the contact type 'Author' and only 1 has the title of Mr. Now in this lesson you are going to build two Groups based upon the contact types 'Author' and 'Software' and two groups based upon the Field 'Country'.

GROUPS

To begin, open the Schema and expand the database tree so you can see the Fields, Groups and Views sections below our Contacts Table. Then expand the Groups tree so you see the default group "All Records". To create a new Group, highlight the Table name Contact in the Schema (or any of the tree sections below the Table name) or make any View, associated with the Table in question the current window. Then from the menu select File|Create new|Group... The 'Create a new group' dialog box will be displayed. It has 2 sections, Details and Sort Order; does the Details section look familiar? Name the Group 'Authors' and then select the Field Contact Type and you are going to set your criteria for the field as Authors. I have filled in the details for this first Group in the screen shot below. Don't forget to test the expression.

tut606.gif (11579 bytes)

Then set the sort order as shown in the screen shot below, before you click OK.

tut607.gif (12589 bytes)

Now, on your own, make the following 3 new Groups:   

Group Name

Group Definition

Sort Order

Software Contact Type = Software Last Name
UK Country = UK or Country = United Kingdom Country, Region, City
USA Country = USA or Country = United States Country, Region, City

 

When you are done, look at the Schema: there should now be FIVE groups visible in the tree: 'All Records', 'Authors', 'Software', 'UK', and 'USA'. 

Open up the Contact table in List View and make sure all Filters are removed so you can see all 12 contacts. Scroll to the last column and click the ID column header, this sorts the View by ID. Now you are going to apply a Group, make sure the Contact view has focus (note that the title of the window reads Contacts/All records). From the toolbar on the right side of the screen click the Switch Group button. The title bar should now read Contacts/Authors and only 3 records should be visible (look at the sort order!). Now go ahead and click the Switch Group button again (Software - 3 records), again (UK - 7 records) and again (USA - 2 records) and for a final time to take us back to All Records (all 12 records are there once again) and don't forget to look at the sort order too!

When you are ready, select the UK Group and try a Find using the letters "mr". What did you get? I got Mr Dickens, Mr Izzard and RMR Software.

Here are some hints for working with Groups

To change a Group definition, highlight its name in the Schema and either double click or select the Properties command from the file menu.
To delete a Group, highlight its name in the Schema and then select the Delete command from the File menu or press CTL+D. Deleting a Group has no impact on the actual records in a Table.
To duplicate a Group, highlight its name in the Schema and select the Duplicate command from the File menu. This will open the 'Create new group' dialog box,   with the properties of the original group, but no name.
Only those records for which the evaluated result is TRUE will be displayed. Thus when a group is in effect, if you change data in a Field used in the evaluation of the group and it causes the record to then be evaluated as FALSE, it will no longer be visible in the Group. The exception to this is where the  Group criteria uses data from a related Field. If in the related Table you change the Field data that would then cause the evaluation to be FALSE - this change is not automatically reflected in the View with the Group applied. To handle this situation, you must force a refresh of the View by selecting the Refresh Group command from the View menu.

Save this database for the next tutorial, where you will be making some new Views, and you will then see how Views and Groups can work together.

If you need it, download the Sample Ad Book (07) with Groups.

© LJKern and FoxPop 1999

[Previous] [Index] [Next]