Office 2010 - Access

Lesson 45: Controls

45/76 Lessons 

Overview

“Controls” are components of a form or report data which we can view, enter and edit. I will discuss about reports later but, let us first see what we can do with “Controls”. We have dependent “Control” element, non-dependent “Control” elements and calculated “Control”.

A calculated “Control”

So a “Control” whose data source is an expression and not a field is a calculated “Control”. An example of a calculated “Control”, is seen in lesson 39 where we have entered an expression in a text box.

A dependent “Control”

A “Control” element for which the data source is a table or a query field, is a dependent “Control” element. For example, the text for the name of an employee is retrieved from a table, a dependent “Control”.

A non-dependent “Control” element

A “Control” element that does not meet any of the above requirements, is a non-dependent “Control” element. An example is a label for the title of a form.

In this part of the “Access” 2010 course, I will discuss some of them.

Label

To add a “Control” to your form, select the “Design View” or “Layout View”, then choose the “Design” tab. This gives us a number of different “Controls”. The simplest “Control” is the “Label”. Usually, we use the “Label” to add a title in the “Form header” of the form.

Select the “Control” in the “Ribbon” and click and drag to the position in the form where you want the “Label”. As soon as you release the mouse button you can start typing text. Modify it with the options you’ll find under the “Format” contextual tab.

les45_image001_en

Add a button with the Wizard

The next “Control” that I’m going to discuss is a dependent “Control”, namely the button.

When we add a dependent “Control”, we also use the properties. This can be done manually, or by means of a wizard.

I will take the easiest way to demonstrate this by using the wizard. Before we can use the wizard, we must be sure that this option is selected. Just click the downward pointing arrow in the “Controls” (1) of the “Ribbon” and click the “Use Control Wizards” option. The “Use Control Wizards” option is a toggle, so this is in on or off state. When it is on, it is orange.

les45_image002_en
Ok, with the “Button”option selected, click the “Use Control Wizards”. This opens the Wizard window where you will see that the “Record Navigation” category option in the left column and “go to next record” option in the right column are selected. If you want to run something else when you click this button, then you must choose a different action from one of the several categories.

Click the “Next” button.

les45_image003_en

In the next window of the Wizard you decide whether you want a button with text or an image.
I choose text and type the desired text in the textbox for the button.
Click the “Next” button.

les45_image004_en
In the next wizard window you give the command button a meaningful name. Always use meaningful names when you want to refer to it later.

Click the “Finish” button

les45_image005_en

The button is now added to the form. If you want to try this, open the form in “Form View” and click this button. You will see that it opens the next record.
In the next lesson we will create a button to navigate to the previous record, but we will enter this via the “Properties Window”.

Awesome!
You've completed Lesson 45
START NEXT LESSON