Each Microsoft Access database contains a Visual Basic project, which is
the set of all code modules in the database. In Microsoft Access 7.0, the
database name and the project name are always the same. Therefore in
Microsoft Access 7.0, renaming a database renames the project, and renaming
the project causes your code to decompile.
In Microsoft Access 97 and 2000, when you create a new database, the project name defaults to the database name. However, in these versions of Access, the project name is independent of the database name. If you rename a database file, its project name does not change; therefore, your code is not decompiled.
To set the project name for your database in Access 2000, follow these steps:
1. | Start Access 2000 and open any database. |
2. | Press CTRL+G to open the Immediate window and any existing module. |
3. | On the Tools menu, click MyDatabase Properties.
|
4. | Type the name of your project in the Project Name box, and then click OK.
|
To compile your code under the new project name, follow these steps:
1. | Open any module in Design view.
|
2. | On the Debug menu, click Compile MyDatabase.
|
Steps to Reproduce Behavior
1. | On the Help menu, click Microsoft Access Help.
|
2. | In the What would you like to do? dialog box, type convert access basic code to visual basic, and then click Search.
|
3. | In the Help window, scroll down to the "Renaming a Database" section. Notice the same paragraph that was quoted in the "Symptoms" section. |