Field Uniqueness

I

Izzy

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
 
K

Ken Snell [MVP]

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.
 
J

Jolene Updike

I'm dealing with the same thing right now. The thread "Prevent duplication
of records in two fields" was helpful to me.
 
I

Izzy

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
 
K

Ken Snell [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top