Ms Access 简明教程

MS Access - Modify Form

我们已经学习了几种创建简单数据输入表单的方法。虽然表单简化了数据输入进程;但这些可能无法满足您想要的其他目的。它们可能不会像您预期的那样引人注目或用户友好。

We have learnt several ways to create simple data entry forms. Although the forms ease the process of data entry; these may not serve other purposes that you would want. They may not be catchy or user-friendly for what you have intended.

  1. Upon creating a form, the first thing you will probably want to do is resize or move the controls around.

  2. You might also need to add a control or remove a control.

现在,我们将讨论如何轻松地修改表单。

We will now discuss how to modify your form in an easy way.

Controls

它仅仅描述了表单或报表中用于显示数据、执行操作或作装饰的物品的通用术语,比如线条。换句话说,控件就是任何放置在表单或报表上的内容。

It is merely a generic term used to describe any object on a form or report that displays data, performs actions or items used for decorations such as a line. In other words, a control is just about anything that is placed on a form or report.

以下可以看作是控件:

The following can be considered as controls −

  1. Objects such as labels.

  2. Unbound or bound text boxes that you can use to add or edit or even calculate an expression.

  3. Command buttons that perform actions like Save, Open an e-mail or Print and these buttons are also known as controls.

  4. It is just a generic term for any object on a form or report.

我们现在将了解有关使表单美观并了解如何编辑和修改表单的不同方面。让我们现在打开从 tnlEmployees 列出所有员工的多项表单。

We will now look at the different aspects of making a form presentable and understand how to edit and modify a form. Let us now open our Multiple Items form which lists out all employees from tnlEmployees.

edit form

正如你所看到的员工列表,但并不像非常用户友好的列表。我们的控件超出了大小。它们太大,间距分布开,没有提供非常有用的列表视图。

As you can see a list of employees, but doesn’t really look like a very user friendly list. Our controls are oversized. They are too big, spaced apart and do not provide a very useful list view.

如需编辑此表单上控件的外观,你可以使用两个表单视图。在主页选项卡中,单击 View 下拉菜单。

To edit the appearance of your controls on this form, you have two form views that you can use. In the Home tab, click the View drop-down.

appearance controls

你有布局视图或设计视图,并且这两个视图都用于编辑你的表单。默认情况下打开表单视图;这是你用来与基础数据源交互或编辑的视图。

You have the Layout View or the Design View, and both of these views are used to edit your form. The Form View opens up by default; this is the view you will use to interact with or edit the underlying data source.

若要编辑表单本身的外观,我们需要首先转到布局视图。

To edit the appearance of the form itself, we need to go to the Layout View first.

form itself

当你切换到布局视图时,你会看到一系列上下文选项卡出现。

When you switch to the Layout View, you will see a series of contextual tabs appear.

在 Access 的顶部,你会看到一个标记为 Form Layout Tools 的区域,其中有三个选项卡——设计选项卡、排列选项卡和格式选项卡,并且每个选项卡都有不同的选项,用于设置表单外观的格式。

At the top of Access, you will see an area marked Form Layout Tools with three tabs — Design tab, an Arrange tab, and a Format tab and each of these tabs have different options for formatting the look or appearance of the form.

当你使用鼠标并单击任意一个控件时,你会注意到 Access 会高亮显示表单的指定区域,并且该区域内的所有控件都被浅橙色阴影覆盖,而你选择的实际控件的阴影将比前一个更深或在单击处周围有一个更深的橙色边框。

When you take your mouse and click on any one of these controls, you will notice that Access will highlight a given area of that form and all controls within that area are shaded a light orange whereas the actual control that you select will be shaded darker than the previous one or have a darker orange border around where you click.

layout tools

在这里,你可以通过单击并拖动鼠标来按你的需要调整控件的大小,以调整该控件的高度、宽度或两者。

Here you can resize your controls as you want by clicking and dragging your mouse to resize the height or width or both of that one control.

resize control

在这个特定表单上,当你调整任何一个控件的大小时,还会随之更改表单上其他控件的大小,这是因为这些控件是如何分组的。让我们现在使用鼠标的单击并拖动功能,按你的需要调整所有字段。

On this particular form, when you resize any single control, you also change the size of the rest of your controls on your form, this is because of how these controls are grouped. Let us now adjust all the fields the way you want by using the click and drag function of the mouse.

adjust fields

这是从此布局视图编辑表单中控件的高度和宽度的一种快捷方法。

That is one quick way of editing the height and width of controls in your form from this Layout View.

Themes

在 Access 中,可以通过使用内置主题、颜色和字体样式、自定义填充颜色和为交替行着色来设置表单的格式。让我们打开 frmEmployees

In Access, there are some basic ways to format your forms by using built-in themes, colors, and font styles, customizing fill colors and shading alternate rows. Let us now open frmEmployees.

themes

Access 创建的表单是朴素简洁的。它们在顶部有一个蓝色栏,背景是白色的。

The forms that Access creates are plain and simple. They have a blue bar on the top and a white background.

如果你想了解如何美化这些表单,你可以在设计视图或布局视图中探索设计选项卡中主题区域中的一些选项。

If you want to see how else you can stylize these forms, you can go to the Design View or Layout View and explore some of the options you have on the Design tab in the Themes area.

stylize

如果你点击“主题”下拉画廊,将有许多预设好的主题可供你尝试。将鼠标悬停在任意主题上,你会看到随之改变的预览,如颜色、字体大小和实际使用的字体。要应用特定的样式,只需点击鼠标即可看到它的外观。

If you click on the Themes' drop-down gallery, you have many pre-created themes to try out from. Hovering your mouse over any one of them will give you a preview of changing things like colors and font sizes and the actual font used. To apply a particular style, simply click your mouse on it and you can see what that looks like.

drop down gallery

如果你喜欢某个主题但想要更改颜色,你可以通过返回“设计”选项卡上的“主题”组并选择你喜欢的颜色来调整颜色。还可以创建自定义颜色以匹配你的公司颜色。

If you like the theme but you want to change the colors, you can adjust the colors by going back to the Themes group on the Design tab and choosing the color you like. You can also create custom colors to match your company’s colors.

colors theme

同样,你还可以从一系列字体样式中进行选择。你可以从 Office 套件中预先创建的众多样式中选择一个,也可以自定义那些字体,选择特定的标题字体、正文字体,甚至创建自定义名称并保存该字体组。

Similarly, you also have a series of font styles to choose from. You can choose one from the many that come prebuilt with the Office Suite or you can customize those fonts, choosing a specific heading font, a body font and even creating a custom name for that font group and saving.

heading font

让我们返回到 frmEmployees 。在此表单中,你将看到每隔一行都会用浅灰色阴影填充。

Let us go back to frmEmployees. In this form, you will see that every alternate row is shaded light gray.

row shade

此格式选项称为 Alternate Row Color ,如果你想要在多表单中调整该选项,请转到 Design View

The formatting option is referred to as Alternate Row Color and if you want to adjust that in a multiple form, go to the Design View.

row color

选择该详细信息部分,然后转到“格式”选项卡,在“背景”组中,你应该会看到 Alternate Row Color 的选项。你可以更改交替行的颜色。要查看这有什么效果,只需转到“表单视图”或“布局视图”。

Select that detail section and then go to the Format tab and in background group you should see an option for Alternate Row Color. You can change the colors for alternate rows. To see what that looks like, simply go to the Form View or the Layout View.

change color

如果你完全不想要阴影,可以选择 No Color 作为你的 Alternate Row Color ,它类似于早期版本 Access 中的传统外观。

If you don’t want any shading at all, you can choose No Color as your Alternate Row Color and that is more the traditional look from earlier versions of Access.

no color