|
Filtering in Forms
From NeoWiki
This article is part of the To Base and Back Again tutorial series.
Earlier, we discussed Filtering in Queries and Tables. Now we will look at how to filter in forms. We will do so working with the All Sightings form we created in the last tutorial.
Contents |
Accessing Form Based Filters
- Open the All Sightings form. (In the main database document, click on the Forms icon in the left-hand column, then double click on All Sightings.)
- Make sure that the Form Navigation toolbar is visible. If it is not, go to the View menu, choose Toolbars and then Form Navigation.
- Click on the Form Based Filters button. It is the the button circled in red below:
Sample Filters
Filter by Exact Text
- Click in the cell under the State heading and type BZ
- Click on the funnel icon in the Form Filter window. After a brief pause, all records where the state is BZ appear.
- Click on the Remove Filter/Sort button on the toolbar (The red stop sign with an x) to clear the filter.
Filter by "Contained" Text
The previous example works to find a field with an exact text match. But what if you want to find all records where one field includes a particular word as part of a larger phrase or entry? You need to use place holders
- Click in the cell under the Bird_Name heading
- Type LIKE '*Blue*'
- Click the funnel icon to see the results.
'Note: You can also use the ? character to represent exactly one "wildcard" character. (The * wildcard represents 0 or more arbitrary characters.
Filtering on two fields (AND)
- Click on the Form Based Filters button again
- Click on the check box under the Male heading to check it
- Now click on the Filter Navigation icon in the Form Filter window. (This is the navigator icon with a small funnel on it). A Filter Navigator window will open. It looks like this:
- In the Filter Navigator, click on the words Filter For next to the first funnel
- Now click on the checkbox under the Female heading. The words Female: 0 will appear right below Male: 1.
- Click on the checkbox under the Female heading again to set the condition to Female: 1
- Click the funnel icon in the Form Filter window. After a brief pause, all records where both Male and Female birds of the same species were seen appear.
- Note that if you had left the Female field set at 0 in the navigator, you would have found those records when only males were seen. Unlike queries, where a criteria of Male = TRUE and Female = FALSE would exclude those records where the Female field is recorded as a NULL, form based filters (in my testing) treat a NULL value in a Boolean (Yes/No or TRUE/FALSE) field as a False. So these records are not excluded
- 'Do Not clear the filter before continuing with the next example.
Filtering on two fields (OR)
- Click on the Form Based Filters button again
- If the Filter Navigator window is not open, click on the Filter Navigation button
- Notice the "Or" between the two funnel images. Conditions under any particular funnel function are AND conditions; that is, all of them must be true. But the different funnels represent OR conditions.
- Right-click or control-click on the line that say Female: 1 and select Delete from the contextual menu
- Click on the second (empty) funnel in the Filter Navigator Window. The form will clear again.
- Click on the check box under the Juvenile box
- You may need to click on the flippy triangle to see the entry under the second funnel.
- If necessary, click a second time so that the condition under the second funnel reads Juvenile: 1
- Click on the funnel icon to see the results
Filtering to find Empty (Null) Fields
- Click on the Form Based Filters button again
- If the Filter Navigator window is not open, click on the Filter Navigation button
- Right-click or control-click on the second funnel and choose Delete from the contextual menu.
- Right-click or control-click on the line that says Male: 1 under the first funnel. Select Is Null from the contextual menu that appears. the line will change to Male: IS EMPTY.
- Click on the funnel icon to see the results
Filtering by Date
- Click on the Form Based Filters button again
- If the Filter Navigator window is not open, click on the Filter Navigation button
- Right-click or control click on the first filter and choose Delete from the contextual menu.
- Click in the cell under the Date heading in the main form and type >3/3/1900.
- Neo will reformat the condition to >#03/03/1900# this is the correct formatting for dates
- Click on the funnel icon to see the results
This article in other languages: Français