how to create unique records index

  • Thread starter Thread starter eb1mom
  • Start date Start date
E

eb1mom

I am trying to create a "unique records index" for a table.
Table has three fields, primary field1 is autonumber .
Field2 is date. Field3 is crewID. I need each record
(combination of date and crewID fields)to be unique. If
someone could suggest an article for me to read I would
appreciate it.
 
Hi

not sure of any articles but to create a unique key in a table:
in design view of the table, click on the little icon to the right of the
primary key icon on the toolbar - i'm guessing it's called "index" or
similar
in here you should see the PrimaryKey index and maybe another one, click on
the first blank line in the first column and give your unique key a name
"UniqueKey" is quite acceptable, then in the column to the right of this,
select the first field you want to include in this unique key (ie the Date
field), then under this select the second field (ie the CrewID), then click
on the name of the index again (UniqueKey) and you'll see some properties at
the bottom of the screen - change Unique from No to Yes
close the window
save the table

Let us know how you go.

Cheers
JulieD
 
I am trying to create a "unique records index" for a table.
Table has three fields, primary field1 is autonumber .
Field2 is date. Field3 is crewID. I need each record
(combination of date and crewID fields)to be unique. If
someone could suggest an article for me to read I would
appreciate it.

It's not hard to do when you know where to look!

Open the Table in design view. Click the "Indexes" icon - it looks
like a lightning bolt hitting a datasheet.

Put a name in the left column of the little grid that pops up; select
the date field in the second column, and the CrewID in the next row in
the second column. Specify that the index is unique using the checkbox
at the bottom of the grid.

Note that Date is a reserved word - it would be prudent to rename this
field if that's what you're calling it.
 
Thanks for the help. Real easy when someone points the way.
And just for the record my field is really not named date,
its named ShiftStartDate I was just trying not clutter my
post with useless info. I named a field date in my first
database attempt and it's definately NOT a good thing to do.
 
Back
Top