Set name AutoCorrect options
Name AutoCorrect helps keep your Access desktop database from breaking when the database design is changed. Name AutoCorrect can:
-
Detect when changing the name of a database object will cause other objects to break
-
Automatically correct this problem
-
Log any corrections it makes
By default, name AutoCorrect is set to detect and correct problems, but not to log corrections. Name AutoCorrect does slightly impede system performance, and you might want to turn it off if your database design is not subject to unplanned design changes. Or, you may want Access to keep track of the corrections it makes. You can set name AutoCorrect options for each desktop database.
Note: Name AutoCorrect helps keep the names of database objects synchronized. Other potential design change problems, such as problems arising from deleted database objects, are not directly handled by name AutoCorrect.
In this article
Why should I use name AutoCorrect?
When you work in an Access database that has a design that is frequently changed by users, database objects can stop working if the design of other database objects changes. One way this can occur is when the name of an object changes, but that change is not accompanied by corresponding changes to objects that depend on the original object.
For example, if you create a query that is based on a table named Customers, and the name of the table is later changed to Customer, the query that you created stops working because of this name change. Nothing else is wrong with the query, and if you correct the table name in the query design, the query works again.
The name AutoCorrect feature can track name changes for you, and can automatically correct the names of forms, reports, tables, queries, fields, or controls, such as text boxes.
Name AutoCorrect and object dependency information
Name AutoCorrect creates name maps of object dependency information for tables, queries, forms, and reports. These maps let you to use the Object Dependency task pane to view the list of objects that depend on a selected table or form, and also view the objects that the table or form depends on. The name map of an object is updated every time that you save and close that object.
Note: By default, name change tracking is not enabled in databases that are created by using older versions of Access, even after you convert those databases to a newer database file format. However, you can, enable name change tracking after you convert such databases to a newer format.
When should I not use name AutoCorrect?
Do not use name AutoCorrect in the following situations:
-
Your database design does not change If the design of your database does not change, you can improve system performance by turning off name AutoCorrect.
-
You want to make your database file smaller, and are willing to manage object name changes manually When name AutoCorrect is enabled for a database, you might notice an increase in the database size. This increase is attributable to the name maps that name AutoCorrect creates when it is enabled. If you disable name AutoCorrect, name maps are removed, which reduces the size of the database.
Things that name AutoCorrect does not correct
Name AutoCorrect does not correct the following:
-
Changes to form, report, or control names are not tracked.
-
Table, query, or field names in macros or in code are not corrected.
How name AutoCorrect works
Name AutoCorrect includes three options: Track name AutoCorrect info, Perform name AutoCorrect, and Log name AutoCorrect changes. Each of the last two options depend on the previous option being enabled.
Track name AutoCorrect info
When you enable name AutoCorrect to track name changes for a database, Access does the following:
-
Attempts to gain exclusive access to the database.
-
Searches for objects that are open.
-
Prompts and closes open objects.
-
Updates name maps by opening, saving, and closing all tables, queries, forms, and reports.
-
Returns the database to whatever state it was in before it was promoted to Exclusive.
Interrupted name mapping
Creating name maps can take several minutes. You can press ESC to cancel this step. However, the name maps of some objects will be outdated, and you will not be able to view the dependency information for those objects until the name maps are updated.
Note: If you interrupt Access (by pressing ESC) when it is updating the name maps, Access does not disable the Track name AutoCorrect info option. The Track name AutoCorrect info option remains selected, even though the name maps have not all been updated. To restart the process of updating name maps, use this procedure:
-
On the ribbon, click File > Options to open the Access Options dialog box.
-
In the left pane of the Access Options dialog box, click Current Database.
-
Clear the Track name AutoCorrect info check box, and then click OK. Access will warn you that all open database objects must be closed for the change to take effect.
-
Close and then reopen the database.
-
Reopen the Access Options dialog box, and then under the Current Database category, select the Track name AutoCorrect info check box, and then click OK.
Or, to manually update a particular object's name map, open the object in Design view, and then save the object.
What happens when you disable Track name AutoCorrect info?
When you turn off name AutoCorrect to stop tracking name changes, Access does the following:
-
Attempts to gain exclusive access to the database.
-
Searches for objects that are open.
-
Prompts and closes open objects.
-
Removes name maps from all tables, queries, forms, and reports.
-
Returns the database to whatever state it was in before it was promoted to Exclusive.
If Access does not complete the process of tracking changes or removing name maps, it logs the error in the Name AutoCorrect Save Failures table.
Perform name AutoCorrect
You must first enable the Track name AutoCorrect info option before you can enable the Perform name AutoCorrect option.
When the Perform name AutoCorrect option is enabled, Access uses the name maps to determine that a name change will affect other database objects, and then corrects the name that changed where it occurs in those other objects.
Log name AutoCorrect changes
You must first enable the Track name AutoCorrect info option and the Perform name AutoCorrect option before you can enable the Log name AutoCorrect changes option.
When the Log name AutoCorrect changes option is enabled, Access keeps track of corrections that it makes because of object name changes. Each correction appears as a record in the Name AutoCorrect Log table.
Enable or disable name AutoCorrect options
All three name AutoCorrect options can be enabled in the Access Options dialog box. You can enable or disable name AutoCorrect options only for the current database.
-
On the ribbon, click File > Options to open the Access Options dialog box.
-
In the left pane of the Access Options dialog box, click Current Database.
-
Under Name AutoCorrect Options, select or clear the options that you want:
-
Track name AutoCorrect info When this option is selected, Access keeps track of object name changes in the database. The tracking information is stored in name maps. When you enable this option for the first time, Access creates a name map for each of the existing database objects. The name map stays up-to-date as long as this option remains selected. Name maps are used to fix errors that are caused by renaming, and to generate object dependency information. Name maps cannot be accessed directly.
You must select this option before you can select other name AutoCorrect options.
Note: Enabling this option does not cause name changes to be automatically corrected. Enabling this option only creates the maps that are used for future corrections.
-
Perform name AutoCorrect When this option is selected, Access automatically fixes name changes as they occur. You can select this option only if the Track name AutoCorrect info option is already selected. To perform name AutoCorrect, Access uses the name maps that it created when the Track name AutoCorrect info option was enabled.
You must select this option before you can select the Log name AutoCorrect changes option.
-
Log name AutoCorrect changes Access maintains a log of corrections that name AutoCorrect makes. Each correction appears as a record in the Name AutoCorrect Log table.
-
No comments:
Post a Comment