ACC: Field Object Type Property Returns "Invalid Operation" (115901)
The information in this article applies to:
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
This article was previously published under Q115901
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you assign a variable to a property (such as Type) of a field object
of an Index object, you receive the error message "Invalid Operation." This
occurs for all properties except Name and Attributes.
This article assumes that you are familiar with Visual Basic for
Applications and with creating Microsoft Access applications using the
programming tools provided with Microsoft Access. For more information
about Visual Basic for Applications, please refer to the "Building
Applications" manual.
NOTE: Visual Basic for Applications (used in Microsoft Access for Windows
95, version 7.0) is called Access Basic in version 2.0.
CAUSE
Field objects of an Index object have a subset of the normal properties.
The only valid properties are Name and Attributes, and the Attributes
property has special values. For an Index object's field object, the
Attributes property represents an ascending or descending sort order.
RESOLUTION
If you need to refer to other properties of the field object, use the
TableDef field object. For example, to get the Type property you could use
x = tabledef.fields("myfield").properties("Type")
instead of:
x = tabledef.indexes("Myindex").fields("myfield").properties("Type")
REFERENCES
For more information about the Index object properties, search on "Index
object," and then "Index Object, Indexes Collection Summary" using the
Microsoft Access for Windows 95 Help Index.
For more information about the Index object properties in Access, version
2.0, search on "Index," and then "Index Object, Indexes Collection-Summary"
using the Microsoft Access Help menu.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kberrmsg kbprb kbProgramming KB115901 |
---|
|