In this post, we will be providing you with some techniques for sorting and filtering records in a form.
Just like a datasheet, we can alter the order of the records see.
You can sort a form by clicking into the field you wish to sort and then clicking either Ascending or Descending in the Sort & Filter group in the Ribbon. |
Filtering in Forms
In the above image you can also see the filtering controls. Below we demonstrate the Filter By Selection tool. Highlight some text in a field you wish to filter by and the tool will retrieve all records with that field containing “na”. This is filtering by selection, or filtering by example.
A more advanced filter can be achieved by using filter by form. In this mode we enter our criteria into an instance of the forms detail section and apply our criteria. Below we demonstrate filter by form.
Click on Filter By Form and enter Like “*na*” in the First Name field. We can also add other criteria for other fields, for example StudentID>10 or Email Address ends with *.uk. This will filter the existing form by the criteria provided.
As well as updating the form with our search or filtering results the navigation bar assists by updating itself to reflect the data we can actually see. In the image below, filtered is highlighted in orange, 4 is the number of records in our filter and navigating back and forth moves to records within our recordset and not the underlying query as a whole.
Sorting and filtering in forms is an important way to be able to query the data that Access presents you with.
Related Posts
Dyamically Updating A Combo Box From Another Combo Box FormsForm Design View Explained Forms
Hyperlinking To A Form Forms
Working With Form Objects Forms
I am trying to get my MS Access form Navigation bar to sort ascending instead of descending . How can I do that?