SharedResource.Name 属性 (权限)SharedResource.Name property (Access)

可以使用 Name 属性可以指定或确定字符串表达式,用于标识对象的名称。You can use the Name property to specify or determine the string expression that identifies the name of an object. 读/写 StringRead/write String.

语法Syntax

表达式名称expression.Name

_表达式_一个代表**SharedResource** 对象的变量。expression A variable that represents a SharedResource object.

说明Remarks

有效的名称必须符合 Microsoft Access 的标准命名规则。A valid name must conform to the standard naming conventions for Microsoft Access. 对于 Access 对象, 名称的长度可能最多为64个字符。For Access objects, the name may be up to 64 characters long. 对于控件,名称长度不能超过 255 个字符。For controls, the name may be as long as 255 characters.

新对象的默认名称是对象名称加上一个唯一的整数。The default name for new objects is the object name plus a unique integer. 例如,第一个新窗体 Form1,第二个新窗体为 Form2,依此类推。For example, the first new form is Form1, the second new form is Form2, and so on. 窗体不能与另一个系统对象,如 屏幕 对象相同的名称。A form can't have the same name as another system object, such as the Screen object.

对于未绑定控件,默认名称是控制加上一个唯一的整数类型。For an unbound control, the default name is the type of control plus a unique integer. 例如, 如果您添加到窗体中的第一个控件是文本框, 则其Name属性设置为 "Text1"。For example, if the first control that you add to a form is a text box, its Name property setting is Text1.

对于绑定控件,默认名称是字段的基础数据源中的名称。For a bound control, the default name is the name of the field in the underlying source of data. 如果通过从字段列表中拖动字段创建控件,则字段的 FieldName 属性设置将复制到控件的 名称 属性框中。If you create a control by dragging a field from the field list, the field's FieldName property setting is copied to the control's Name property box.

不能用"窗体"或"报表"命名控件或节。You can't use "Form" or "Report" to name a control or section.

同一窗体、报表或数据访问页上的控件不能具有相同的名称, 但不同窗体、报表或数据访问页上的控件可以有相同的名称。Controls on the same form, report, or data access page can't have the same name, but controls on different forms, reports, or data access pages can have the same name. 同一窗体上的控件和节不能共享一个名称。A control and a section on the same form can't share the same name.

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.