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 detects and corrects problems, but it doesn't log corrections. Name AutoCorrect can slightly affect performance, so you might want to turn it off if your database design isn't likely to change unexpectedly. Or, you might want Access to keep track of the corrections that it makes. You can set name AutoCorrect options for each desktop database.
Note
Name AutoCorrect helps keep the names of database objects synchronized. It doesn't directly handle other design change problems, such as problems that come from deleted database objects.
In this article
- Why should I use name AutoCorrect?
- How name AutoCorrect works
- Enable or disable name AutoCorrect options
Why should I use name AutoCorrect?
When you work in an Access database whose design changes often, database objects can stop working when the design of other database objects changes. For example, this can happen when the name of an object changes, but objects that depend on the original object aren't updated.
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. It can also 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 use the Object Dependency task pane to view the list of objects that depend on a selected table or form. They also let you view the objects that the table or form depends on. The name map of an object is updated each time that you save and close that object.
Note
By default, name change tracking isn't enabled in databases that were created in older versions of Access, even after you convert those databases to a newer file format. However, you can enable name change tracking after you convert those databases.
When should I not use name AutoCorrect?
Don't use name AutoCorrect in the following situations:
- Your database design doesn't change If the design of your database doesn't change, you can improve performance by turning off name AutoCorrect.
- You want to make your database file smaller, and you're willing to manage object name changes manually When name AutoCorrect is enabled for a database, you might notice that the database gets larger. This increase comes from the name maps that name AutoCorrect creates. 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:
- Tries to gain exclusive access to the database.
- Searches for objects that are open.
- Prompts you to close open objects, and then closes them.
- 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 for some objects will be outdated, and you won't be able to view dependency information for those objects until the name maps are updated.
Note
If you interrupt Access by pressing Esc while it updates the name maps, Access doesn't disable the Track name AutoCorrect info option. The Track name AutoCorrect info option stays selected, even though not all name maps have been updated. To restart the process of updating name maps, use this procedure:
- On the ribbon, select File > Options to open the Access Options dialog box.
- In the left pane of the Access Options dialog box, select Current Database.
- Clear the Track name AutoCorrect info check box, and then select OK. Access warns 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. Then, under Current Database, select the Track name AutoCorrect info check box, and select OK.
Or, to manually update a particular object's name map, open the object in Design view and then save it.
What happens when you disable Track name AutoCorrect info?
When you turn off name AutoCorrect to stop tracking name changes, Access does the following:
- Tries to gain exclusive access to the database.
- Searches for objects that are open.
- Prompts you to close open objects, and then closes them.
- 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 doesn't 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 whether a name change affects other database objects. It then corrects the changed name wherever it appears 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, select File > Options to open the Access Options dialog box.
In the left pane of the Access Options dialog box, select 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 existing database object. 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. You can't access name maps 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 Logtable.