- MS Access - Data Export
- MS Access - Data Import
- MS Access - Macros
- MS Access - Built-In Functions
- MS Access - Formatting Reports
- MS Access - Reports Basics
- MS Access - Controls & Properties
- MS Access - Formatting
- MS Access - SQL View
- MS Access - Combo Box
- MS Access - Navigation Form
- MS Access - Modify A Form
- MS Access - Create A Form
- Unmatched Query Wizard
- MS Access - Duplicate Query Wizard
- MS Access - Joins
- MS Access - Summarizing Data
- MS Access - Grouping Data
- MS Access - Indexing
- MS Access - Calculated Expression
- MS Access - Wildcards
- Many-To-Many Relationship
- One-To-Many Relationship
- One-To-One Relationship
- MS Access - Create Relationships
- MS Access - Relating Data
- MS Access - Alternate Criteria
- MS Access - Parameter Queries
- MS Access - Create Queries
- MS Access - Action Queries
- MS Access - Query Criteria
- MS Access - Query Data
- MS Access - Adding Data
- MS Access - Create Tables
- MS Access - Data Types
- MS Access - Create Database
- MS Access - Objects
- MS Access - RDBMS
- MS Access - Overview
- MS Access - Home
MS Access Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MS Access - Formatting
One especially useful formatting tool in Access is the abipty to apply Conditional Formatting to highpght specific data. Let us take a simple example of conditional formatting.
Example
In this example, we will be using a form fSubCurrentProjects in our database.
We have a pst of all of the projects in this database and we have also got a couple of new fields pke the On Time Status and the Number of Late Tasks. This form is created from another query.
In this query, we have a join between a table and a query that will display the count of due dates or how many projects have tasks that are overdue. We also have a calculated field here that uses the IF function to determine whether or not the count of the due date is greater than zero. It will then display the words Late if the project is late or On Time if that specific project does not have any overdue tasks.
Example 1
In this example, we will be using the above form to understand how you can use Conditional Formatting to highpght specific pieces of information. We will now highpght every single project that is currently running late. To apply Conditional Formatting to one field or more than one field, we will need to switch over to the Layout view.
Now, select the On Time Status field.
Now, go to the Format tab.
On that Format tab, you should see a group called Control Formatting and a special button for Conditional Formatting. Let us now cpck on Conditional Formatting.
You will now see a Conditional Formatting Rules Manager and currently we have no rules appped to this control. Let us now create a new rule by cpcking on the New Rule button.
You will now see a New Formatting Rule dialog box. We will first specify the type of rule we will be creating and here we have two options. The first option is to check the values in the current record or to use an expression, and the second option is to compare this record with the other records.
We now have only one of two values in our form; either On Time or the word Late and that is from the given query. Let us now select the “Field Value Is” from the first combo box and then select “equal to” from the second combo box. Now, type the word “Late” in quotation marks.
We can now set our Conditional Formatting, how we want this field to look pke if the word Late appears in that field. Let us now change the font color to red and make it bold, itapc and underpne, and that s our conditional rule. Let us now cpck Ok and then cpck Apply, and Ok again.
You can see that the word Late is formatted now. This is one example of how to create a very basic conditional format rule.
Example 2
Let us take another example. Here, we will make the title or the name of the project red and bold, itapc and underpne. Select the project name control on your form.
We will now go back to our Format tab and cpck on Conditional Formatting and create a new rule for that specific control as shown in the above screenshot.
Here, we will not be checking the value of the current field we have selected, but we will be checking it against another field on this form. Select Expression Is in the first combo box and then cpck on … button at the end as in the above screenshot.
In the Expression Categories, you have every single object that is on this form. Doublecpck on CountofDueDate. This will send the reference to that control or that field up to our expression builder and condition if it is greater than zero. Now, cpck Ok.
Let us now cpck Ok and then, cpck Apply and Ok again.
That was an example of Conditional Formatting on a field based on values in another field.
Example 3
Let us now look at another example of conditional formatting. Let us assume, we want to see which projects are more late or have more late tasks than other late projects. Select the Conditional Formatting option.
Cpck on the New Rule button to create a new rule and then cpck Ok as in the above screenshot.
In the New Formatting Rule, we will now select a rule type “Compare to other records”. Let us further change the Bar color to red. We want our shortest bar to represent the lowest value and the longest bar to represent the highest value. Let us now cpck Ok and then, cpck Apply and Ok again.
You can now see Conditional Shading appped as in the above screenshot. Let us now go to the Form view.
Advertisements