G
Guest
Can a field be set to 'index-duplicates ok' by using a macro?
Thanks,Kat3n
Thanks,Kat3n
Ed Robichaud said:Pretty sure NOT, and why would you want to do that? If you've set a unique
index that you need to periodically "relax", then you should rethink your
keys/indexes.
Setting a [LastName] field to a unique index to prevent duplicates is not
the way to handle that. Rather, index on [Lastname]+[FirstName], then use
some code to alert users to possible duplicates during data entry.
The BeforeUpdate event can be used to trigger a DLookup statement, that if
true, would display a MsgBox.
-Ed
Kat3n said:Can a field be set to 'index-duplicates ok' by using a macro?
Thanks,Kat3n
Kat3n said:Thanks for the response, Ed.
This is what I am trying to do and please tell me if there is a better
way:
Each morning I import 2 ODBC tables using a macro. Once the tables are
imported I open the tables and choose a primary key field on one table and
a
primary key field plus an 'Index-Duplicates OK' on another field in the
second table. The tables import with no indexes at all and the database
response is very slow. Once the primary keys and index field is set the
database response is great. It would be helpful if I could create a
command
button to import the tables and set the primary keys and indexes with one
click of a button. Suggestions, please. Thanks.
--
Kat3n
Ed Robichaud said:Pretty sure NOT, and why would you want to do that? If you've set a
unique
index that you need to periodically "relax", then you should rethink your
keys/indexes.
Setting a [LastName] field to a unique index to prevent duplicates is not
the way to handle that. Rather, index on [Lastname]+[FirstName], then
use
some code to alert users to possible duplicates during data entry.
The BeforeUpdate event can be used to trigger a DLookup statement, that
if
true, would display a MsgBox.
-Ed
Kat3n said:Can a field be set to 'index-duplicates ok' by using a macro?
Thanks,Kat3n