Background
Total Access Analyzer is the world's leading Microsoft Access add-in product and designed to help you create better Microsoft Access solutions through comprehensive documentation and analysis. Total Access Analyzer offers more than 380 Reports, making it the most power documentation and analysis program for Microsoft Access professionals.
Problem
When Total Access Analyzer tries to document the forms in your Microsoft Access database, it crashes with this error:
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
Solution
Cause
Your database may be corrupt. This can occur if Microsoft Access thinks two forms have the same name. That should never happen.
Diagnostics
To determine if this is the case, add the VBA code below into a module in your database and run it. A message will appear if duplicate form names are encountered (they are listed consecutively in the Forms collection):
Sub TestForms() Dim intForms As Integer Dim i As Integer Dim strName As String intForms = CurrentProject.AllForms.Count strName = "" For i = 0 To intForms - 1 If strName = CurrentProject.AllForms(i).Name Then MsgBox "Duplicate form name: " & strName End If strName = CurrentProject.AllForms(i).Name Next i MsgBox "Done" End Sub
If this code detects duplicate form names, it also appears as duplicates in the Total Access Analyzer documentation Wizard when selecting the forms to document. Total Access Analyzer crashes because it does not expect duplicate form names to occur.
Renaming the Duplicate Form Name Does Not Work
In our experience, if a duplicate form name is detected, simply renaming the form doesn't fix the problem. Renaming the form and running the code again may show a different duplicate form name that didn't exist in the previous run. The database is corrupted.
If a Microsoft Access database is corrupted, it is not easy to determine the extent of the corruption. It may involve much more than the list of form names. Ideally, you have a backup of your database that you can recover. Create a new database and import all the objects from your current database into it. If you have VBA library references in your modules, you need to reset those manually for your database to work.
Once your database is recreated, run the code above to confirm the problem no longer exists. Rerun Total Access Analyzer to analyze your database.
Future Solution
This issue is logged for our development team to handle in a future release of Total Access Analyzer. That will prevent Total Access Analyzer from crashing, but your database is still corrupt and you'll need to address that.
Comments
0 comments
Please sign in to leave a comment.