ACC: Using "Name" in ExpressionsID: Q112130
|
Moderate: Requires basic macro, coding, and interoperability skills.
All Microsoft Access version 2.0 objects have a Name property, but
Microsoft Access version 1.x objects do not. A Microsoft Access 1.x
database does not run correctly in Microsoft Access 2.0 if you refer to
Name as an ambiguously qualified object in the 1.x database. To correct
this, Microsoft Access treats Name as a special case when you are using a
1.x database.
With the advent of Microsoft Access 2.0 and data access objects (DAO), all
objects have a Name property. Name is also a very common field name. This
creates a conflict when you are running a 1.x database in Microsoft Access
2.0. When you refer to an ambiguously qualified object, both Microsoft
Access 1.x and 2.0 have a predetermined search path to locate the object.
The search order is as follows:
Properties, controls, fields
Controls, fields, properties
ControlSource: =[Name]
SetValue
Item: [Name]
Expression: UCase([Name])
DLookup("[ID]","MyTable","[Name]=Form.Name")
Set MySnap = MyDB.ListTables()
Debug.Print MySnap.Name
ControlSource: =Report![Name]
SetValue
Item: Form![Name]
Expression: UCase(Form![Name])
DLookup("[ID]","MyTable","[Name]=Form!Name")
Set MySnap = MyDB.ListTables()
Debug.Print MySnap!Name
For more information about identifiers in expressions, search for "identifiers in expressions" using the Microsoft Access 2.0 Help menu.
Additional query words: dao
Keywords : kbusage ExrOthr
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: April 3, 1999