Duplicates (1 Viewer)

TobyMace

Registered User.
Local time
Today, 21:20
Joined
Apr 13, 2018
Messages
65
Hi All,

Is there a way of allowing some duplicates through in column A but only if column B equals a certain value?
I would define the value(s) in column B and this would allow any entry into column A any number of times. Otherwise duplicates are not allowed in A.

Thanks.
 

bob fitz

AWF VIP
Local time
Today, 21:20
Joined
May 23, 2011
Messages
4,719
I'd use the BeforeUpDate event of the form used to enter the data to handle the validation. If the validation fails the update can then be cancelled.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:20
Joined
Feb 19, 2002
Messages
43,233
Leave the autonumber as the primary key but add a unique index on the combination of the two fields. To make a multi-field index:
1. open the table in design view
2. press the indexes icon
3. On the first completely empty line in the dialog, add an index name
4. choose the first column of the index
5. Set the unique property to yes and the ignore nulls property to no
6. On the next empty line, leave the index name blank
7. add the second column for the index.
8. repeat #7 for as many columns as you need for a maximum of 10 since 10 is all Access can support.
9. Save the change.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 06:20
Joined
Jan 20, 2009
Messages
12,851
I suspect your data structure may have room for improvement. It is usually the case when trying to partly disable functionality.

Can you describe what you are recording?
 

Users who are viewing this thread

Top Bottom