PC Review


Reply
Thread Tools Rate Thread

How do I find the indices on a table in Access 2003?

 
 
esharris
Guest
Posts: n/a
 
      12th Nov 2008
I am trying to find an index on a table.

I inherited a MS Access 2003 database containing a table. If I add a row to
that table whose XXX field value is not unique to that table, I get the
following error message.

"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."

The XXX fields is not the primary key; I checked the table's design view. So
I assume the problem is in some index.

How do I find the related index?
Thank You.
 
Reply With Quote
 
 
 
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      12th Nov 2008
The indexes are displayed with the table in Design View:

View >>> Indexes
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"esharris" <(E-Mail Removed)> wrote in message
news:1E1BA8D1-37EC-4B70-AD48-(E-Mail Removed)...
>I am trying to find an index on a table.
>
> I inherited a MS Access 2003 database containing a table. If I add a row
> to
> that table whose XXX field value is not unique to that table, I get the
> following error message.
>
> "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."
>
> The XXX fields is not the primary key; I checked the table's design view.
> So
> I assume the problem is in some index.
>
> How do I find the related index?
> Thank You.



 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      12th Nov 2008
Easiest way is to open the table in design view, then select Indexes from
the View menu.

When the "Index Name" field is blank, the fields listed are part of the last
value shown for Index Name.

Put the cursor on each unique Index Name, and look in the Unique box in the
bottom left-hand corner.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"esharris" <(E-Mail Removed)> wrote in message
news:1E1BA8D1-37EC-4B70-AD48-(E-Mail Removed)...
>I am trying to find an index on a table.
>
> I inherited a MS Access 2003 database containing a table. If I add a row
> to
> that table whose XXX field value is not unique to that table, I get the
> following error message.
>
> "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."
>
> The XXX fields is not the primary key; I checked the table's design view.
> So
> I assume the problem is in some index.
>
> How do I find the related index?
> Thank You.



 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      12th Nov 2008
On Wed, 12 Nov 2008 09:11:03 -0800, esharris
<(E-Mail Removed)> wrote:

>I am trying to find an index on a table.
>
>I inherited a MS Access 2003 database containing a table. If I add a row to
>that table whose XXX field value is not unique to that table, I get the
>following error message.
>
>"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."
>
>The XXX fields is not the primary key; I checked the table's design view. So
>I assume the problem is in some index.
>
>How do I find the related index?
>Thank You.


Here's a little routine that will list them all in the Immediate window; you
could adapt it to print them out or store them in a table if you wish.

Sub ShowAllIndices()
Dim db As DAO.Database
Dim tdf As TableDef
Dim idx As Index
Dim fld As Field
Set db = CurrentDb()
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
Debug.Print tdf.Name
For Each idx In tdf.Indexes
Debug.Print Tab(5), idx.Name
For Each fld In idx.Fields
Debug.Print Tab(10), fld.Name
Next fld
Next idx
End If
Next tdf
End Sub
--

John W. Vinson [MVP]
 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      14th Nov 2008
esharris <(E-Mail Removed)> wrote:

>I inherited a MS Access 2003 database containing a table. If I add a row to
>that table whose XXX field value is not unique to that table, I get the
>following error message.


Now that unique index might be a very useful one. Interesting problems
might happen with some queries.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2003: Error says it can't find th table just created in SQL =?Utf-8?B?RWF0b24=?= Microsoft Access Database Table Design 3 31st Jul 2007 07:08 PM
Re: Creating Access table indices and keys with vba Douglas J. Steele Microsoft Access VBA Modules 0 30th Nov 2006 10:24 PM
Inserting Access data into an Oracle table with indices =?Utf-8?B?RGFsZSBGeWU=?= Microsoft Access Queries 1 26th Sep 2006 03:41 PM
how do I find a random record in an Access 2003 table or query? =?Utf-8?B?Z3VpbGRlcnNsZWV2ZTE=?= Microsoft Access 1 7th Nov 2004 08:54 PM
Access 2002: Linking table indices George Fowler Microsoft Access Database Table Design 2 11th Jun 2004 12:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:12 AM.