Microsoft Office Access 2010 brought new tools to align controls during design. Those tools are available in the Arrange tab of the Ribbon. Those tools are available when the form or the report is in Design View. These tools make it easy for Microsoft Access to automatically stack or juxtapose a group of controls.
One of the ways you can align the controls is to stack them; that is, to position controls above each other. Besides the manual techniques we saw already, to stack a group of controls, first select them. Then, on the Ribbon, click Arrange. In the Table section, click Stacked ![]()
Besides the techniques we saw to position the controls next to each other, you can treat their positions as cells of a table and align them accordingly. To do this, select the control. Then, in the Table section of the Arrange tab of the Ribbon, click Tabular ![]()
Before taking any action on a group of stacked or juxtaposed controls, you must first select them. You have three options:
![]() Click it.
If you use the Stacked or the Tabular button to align the controls, Microsoft Access adds some grid lines around the control(s). By default, those grid lines are invisible but if you want, you can show them. You can even paint them in any color of your choice. The visibility of the grid lines around the objects is controlled by the Gridlines button: ![]() Before controlling the grid lines, on the form or report, click one of the controls in the group. You should see a gray square with a cross inside. Click it:
There are many actions you can take on the controls that belong to a stacked or tabular group of control. As you may know already, the controls are considered as a group and must be treated so. To separate them and treat each individually, select the group. In the Table section of the Arrange tab of the Ribbon, click the Remove Layout button ![]() To delete all controls from the group, after accessing the group:
Normally, when you select some controls and click the Stacked button, Microsoft Access uses the number of vertical ranges to decide how many columns to create. If those are not enough, you can add new empty columns. To do this, select the group. On the Ribbon, click Arrange. In the Rows & Columns section:
When you create a group of controls using the Tabular option, Microsoft Access uses the number of columns to decide how many rows to create. If you want, you can add new empty rows. To do this, select the group. On the Ribbon, click Arrange. In the Rows & Columns section:
If you insert a row inside the group, it would appear empty while the objects on the other row(s) move. You can then move an existing control from its current position to the empty cell above or below. To do this, click the control. On the Ribbon, click Arrange. In the Move section, click either Move Up ![]() ![]()
If you had applied some design on a control and you want to replicate that design, you can copy the control. This is mostly a simple operation of copy n' paste. You can copy a control on a form (or report) and paste it on the same form (or report) or you can paste it in another form (or report). When you copy and paste a control, there are some characteristics it would retain and some others it would loose. Normally, it would keep its aesthetic characteristics (such as the color) and its size but it will loose some others (such as its location and its programmatic characteristics such as its name (we will learn that two controls cannot have the same name on the same form or report). To copy a control, first select it and then press Ctrl + C. You can also right-click a control and click Copy. To control a group of controls, select them and press Ctrl + C. You can also select the controls, right-click one of the selected controls, and click Copy. To paste a copied control or a copied group of controls from the clipboard, click the destination and press Ctrl + V. You can also right-click the destination and click Paste.
If you have added a control or it was created by the Form Wizard or the Report Wizard but you don't need it anymore, you can remove it from the database. You can also delete a group of controls in one step. To remove a control from a form or a report, click it and press Delete. If you click a text box or a control that is accompanied by a label and delete it, its label is deleted also. To remove a group of controls, select them and press Delete.
When we introduced data entry for a form, we saw that the user could press Tab to move from one control to another. For example, after the user has entered data in the most left text box of the form, if there is another text box on the right side, when the user presses Tab, the caret should move to that right control. If there is no control on the right side, the caret should move to the control under the one previously used. If the caret or focus is in the last bottom control on the form and the user press Tab, the caret should move to the next record, unless the form is configured to display only one record. This follows the arranged sequence of the controls on the form. For this reason, the controls on a form should be aligned in the order of a logical sequence. When you add a control to a form that already has other controls, it is sequentially positioned at the end of the existing controls. If you don't fix it, the data entry personnel could have a hard time figuring out how the sequence should be followed. The sequence of controls navigation is set using the Tab Order dialog box. The Tab Order dialog box is available when the form is opened in Design View. To display it, while the form is in Design View:
This would open the Tab Order dialog box: ![]() The simplest and quickest way to rearrange the order of items is to click the Auto Order button. Sometimes, you will not like the arrangement made by the Tab Order dialog box. To rearrange items manually, you can move a row or a group of rows.
|
Tuesday, June 11, 2013
Maintaining Windows Controls
Related Posts
Subscribe to:
Post Comments (Atom)
EmoticonEmoticon