Hi Bill,
not correct
a table can have 32 indexes.
more than one index can have the Unique constraint set
by definition, PK (Primary Key) is Unique.
In a Types table (ie: PhoneType), I will only allow one value of the text. So "Home" and "Work" would not be in the list more than once. In this case, there are 2 unique indexes: 1 because of the PrimaryKey and the other because of the unique index on text value for PhoneType. Unique indexes can have multiple fields -- so the combination has to be unique as opposed to just one field. when a Unique index is set, if it will not always be filled out and that is ok, set the IgnoreNulls property of the Index to True. this is set in the Indexes window (lightening bolt icon in table design)
Warm Regards,
Crystal
*
(: have an awesome day :)
*
________________________________
From: Bill Singer
Crystal,
I may want to do this with a few more tables. Am I correct in understanding
that I will have to remove the PK as a unique index.
Bill Singer
From: Crystal
Hi Bill,
I often create unique indexes too -- the unique index prevents duplicates
during batch appends, but I don't use it as a way to inform the user of
anything
Use the form BeforeUpdate event to do validation and issue friendly
messages.
Warm Regards,
Crystal
Microsoft MVP
remote training and programming
www.AccessMVP.com/strive4peace
www.YouTube.com/LearnAccessByCrystal
www.YouTube.com/LearnByCrystal
* (: have an awesome day :) *
________________________________
From: Bill Singer <Bill.Singer@at-group.net
<mailto:Bill.Singer%40at-group.net> >
To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
Sent: Thursday, May 17, 2012 12:18 PM
Subject: RE: [MS_AccessPros] Indexes
I have created a unique index on a table to prevent duplicate records from
being added,(you can't play two events at the same facility at the same
time) however the error message that comes up is not very user friendly. I
am wondering if there is a way to change that message?
The other option is to put a test and message box in the before update
property of the button that runs that append query that updates the table.
However this programming is a bit more difficult for me.
Thanks for steering me in the right direction.
Bill Singer
MN
[Non-text portions of this message have been removed]
Kamis, 17 Mei 2012
Re: [MS_AccessPros] Indexes
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar