validtaion question #2

  • Thread starter Thread starter skully matjas
  • Start date Start date
S

skully matjas

I imported a table from a differnt databse, know i nead to
enter a uniqe number for each person. I cant have the
numbers randomly genterated, the numbers are coming from a
different scource. how can i make it that it checks it as
i enter the number into the form. a primary key wont work
for this, since when i first try to ceate a primary key in
the table, it syas that the field cant be null.

thank you
 
I imported a table from a differnt databse, know i nead to
enter a uniqe number for each person. I cant have the
numbers randomly genterated, the numbers are coming from a
different scource. how can i make it that it checks it as
i enter the number into the form. a primary key wont work
for this, since when i first try to ceate a primary key in
the table, it syas that the field cant be null.

Are you manually entering the numbers? How will you be able to
determine that they are unique within the table if they're not entered
yet!?

Try selecting the field in table design view; in the field properties
at the bottom of the screen select the Index row, and specify that the
field is "Indexed (No duplicates)". This will permit NULLS but
prohibit duplicates. Once you have all the rows populated with unique
numbers, you can define this field as a Primary Key; newly entered
records thereafter will need to have a unique value for the field at
the time that they are entered. If this "different source" is such
that you must enter names first and then add the numbers later, you
may want to add an Autonumber field as a "surrogate" primary key,
while maintaining the unique Index.

How do you ensure that two people who happen to have the same name get
different numbers, and how do you determine which person gets which
number?
 
Back
Top