ACC2: Reference to Field's Caption Property Can Cause an Error (132019)
The information in this article applies to:
This article was previously published under Q132019 SUMMARY
Advanced: Requires expert coding, interoperability, and multiuser skills.
You may receive an error message if you reference a field's Caption
property when the following two conditions are true for the Caption
property:
- The Caption property of a local table is null.
- The Caption property is not null, but belongs to an attached table.
The error message occurs because, to Microsoft Access, the Caption property
does not exist if it has not been assigned a value. Therefore, you must
ensure that your code traps the error that results when a Caption property
contains a Null value. If the Caption property belongs to an attached
table, the error trapping routine must also use the OpenDatabase method.
NOTE: Although this article focuses on the Caption property, this
information also applies to other Microsoft Access application-defined
properties of the Field object.
This article assumes that you are familiar with Access Basic and with
creating Microsoft Access applications using the programming tools provided
with Microsoft Access. For more information about Access Basic, please
refer to the "Building Applications" manual.
REFERENCES
Microsoft Access "Building Applications," version 2.0, Chapter 5, "Access
Basic Fundamentals" pages 113-132
Microsoft Access "Building Applications," version 2.0, Chapter 7, "Object
and Collections" pages 155-181
Microsoft Access "Building Applications," version 2.0, Chapter 10,
"Handling Run-Time Errors" pages 221-238
For more information about the Field object, search for "Field," and then
"Field Object, Fields Collection" using the Microsoft Access Help menu.
For more information about the Caption Property, search for "Caption," and
then "Caption Property" using the Microsoft Access Help menu.
Modification Type: | Major | Last Reviewed: | 11/6/2000 |
---|
Keywords: | kberrmsg kbinfo kbprogramming KB132019 |
---|
|