简体   繁体   English

ms-access:控制源和行源之间的差异

[英]ms-access: difference between control source and row source

i have learning reports in access and i don't understand the difference between these two concepts. 我有访问中的学习报告,我不明白这两个概念之间的区别。 i understand that the control source is the column? 我明白控制源是列? but then what is the row source? 但是什么是行源?

Row Source is typically used to determine how to build a list of items whereas Control Source determines what field will be used to store or retrieve the value. Row Source通常用于确定如何构建项目列表,而Control Source确定将使用哪个字段来存储或检索值。 For example, in a Combo Box you have both properties. 例如,在Combo Box您有两个属性。 The Row Source determines how to build the list the user sees when they hit the down arrow. Row Source确定如何构建用户在按下向下箭头时看到的列表。 The Control Source determines where to store the value that the user selects. Control Source确定存储用户选择的值的位置。

EXAMPLE Suppose we have a form that is bound to table called Cars which lists information about automobiles. 示例假设我们有一个绑定到名为Cars表的表单,其中列出了有关汽车的信息。 One of the columns in this table is used to store the color of the car. 此表中的一列用于存储汽车的颜色。 Let's suppose that column is named BodyColor . 我们假设该列名为BodyColor You also have another table of allowed colors (eg Blue, Yellow, Green, Steel Blue, Midnight Blue etc.). 您还有另一张允许颜色的表格(例如蓝色,黄色,绿色,钢蓝色,午夜蓝色等)。 You want to ensure that users choose from this list of colors when they enter a value for the car's color. 您希望确保用户在输入汽车颜色的值时从此颜色列表中进行选择。

On our form we add a Combo Box where we set the following properties: 在我们的表单上,我们添加了一个组合框,我们在其中设置以下属性:

Control Source  :   BodyColor
Row Source      :   SELECT Colors.Name FROM Colors ORDER BY Colors.Name;
Row Source Type   :   Table/Query

When a user sees your Combo Box, they will be able to hit the down arrow on the Combo Box and see a list of colors. 当用户看到您的组合框时,他们将能够点击组合框上的向下箭头并查看颜色列表。 When they choose a color, the Form will save their selection into the BodyColor column. 当他们选择颜色时,表单会将他们的选择保存到BodyColor列中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM