Field Uniqueness

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

Is there any way of specifying that a record
can only be added to a table once. eg. If a
record already exists with [ModelID]=1 and
[CarPartID]=462 it would then not be added
again.
In other words where a records uniqueness is
dependent upon the contents of 2 fields?

Thanks for any suggestions
 
Define an index that consists of those two fields. Click on Indices icon on
toolbar, enter a name for the index in the first column on left, then in the
middle column choose one of the two fields, then in the middle column of the
second row choose the other field.

While on that first row, you can set the Unique property (bottom of the
popup window) to Yes.
 
I'm dealing with the same thing right now. The thread "Prevent duplication
of records in two fields" was helpful to me.
 
Thanks Ken, it works a treat and solves the problem.
I really appreciate your speedy response.
Regards

Ken Snell said:
Define an index that consists of those two fields. Click on Indices icon on
toolbar, enter a name for the index in the first column on left, then in the
middle column choose one of the two fields, then in the middle column of the
second row choose the other field.

While on that first row, you can set the Unique property (bottom of the
popup window) to Yes.

--

Ken Snell
<MS ACCESS MVP>

Izzy said:
Hello

Is there any way of specifying that a record
can only be added to a table once. eg. If a
record already exists with [ModelID]=1 and
[CarPartID]=462 it would then not be added
again.
In other words where a records uniqueness is
dependent upon the contents of 2 fields?

Thanks for any suggestions
 
You're welcome.

--

Ken Snell
<MS ACCESS MVP>

Izzy said:
Thanks Ken, it works a treat and solves the problem.
I really appreciate your speedy response.
Regards

Ken Snell said:
Define an index that consists of those two fields. Click on Indices icon
on
toolbar, enter a name for the index in the first column on left, then in
the
middle column choose one of the two fields, then in the middle column of
the
second row choose the other field.

While on that first row, you can set the Unique property (bottom of the
popup window) to Yes.

--

Ken Snell
<MS ACCESS MVP>

Izzy said:
Hello

Is there any way of specifying that a record
can only be added to a table once. eg. If a
record already exists with [ModelID]=1 and
[CarPartID]=462 it would then not be added
again.
In other words where a records uniqueness is
dependent upon the contents of 2 fields?

Thanks for any suggestions
 
Back
Top